2945 local (#2992)

* Added Django environment folder in exclusion

Django projects have env/ folder in which dependencies of the project like Django, Pillow, and other libraries are installed from the requirements.txt file. It would be best if this folder of dependencies is ignored from the language statistics.

* Corrected Errors

Corrected the misplaced code and put removed the start character as the environment folder may not always be in the root.

* Adding test for env folder
This commit is contained in:
Arfon Smith
2016-05-06 15:36:07 -06:00
parent 91ea482ea6
commit 3191ff498d
3 changed files with 6 additions and 3 deletions

View File

@@ -190,6 +190,7 @@
# django
- (^|/)admin_media/
- (^|/)env/
# Fabric
- ^fabfile\.py$

View File

@@ -19,7 +19,7 @@ class TestFileBlob < Minitest::Test
blob.instance_variable_set(:@name, 'script')
blob
end
def test_extensions
assert_equal [".gitignore"], Linguist::FileBlob.new(".gitignore").extensions
assert_equal [".xml"], Linguist::FileBlob.new("build.xml").extensions
@@ -312,11 +312,13 @@ class TestFileBlob < Minitest::Test
# Debian packaging
assert sample_blob("debian/cron.d").vendored?
# Django env
assert sample_blob("env/foo.py").vendored?
# Erlang
assert sample_blob("rebar").vendored?
# git config files
assert_predicate fixture_blob("some/path/.gitattributes"), :vendored?
assert_predicate fixture_blob(".gitignore"), :vendored?
assert_predicate fixture_blob("special/path/.gitmodules"), :vendored?

View File

@@ -36,7 +36,7 @@ class TestGenerated < Minitest::Test
generated_loading_data(File.join(samples_path, name))
end
def test_check_generated
def test_check_generated
# Xcode project files
generated_sample_without_loading_data("Binary/MainMenu.nib")
generated_sample_without_loading_data("Dummy/foo.xcworkspacedata")