Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileGlobs.py: Recursively extract .npmignore globs #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

prachi1210
Copy link
Member

Looks for .npmignore in dirs and subdirs recursively
and extract file globs

Closes #109

self.log_printer, self.printer, os.getcwd())[0]),
sorted(files))

os.remove(os.path.join("other_folder",".npmignore"))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E231 missing whitespace after ',''

PycodestyleBear (E231), severity NORMAL, section autopep8.

os.path.join(os.getcwd(), "other_folder"),
os.path.join(os.getcwd(), "sample_data", "data")]

globs = list(get_npmignore_glob(os.getcwd(),npmignore_dir_list))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E231 missing whitespace after ',''

PycodestyleBear (E231), severity NORMAL, section autopep8.

os.path.join("src", "abc.pyc"),
os.path.join("other_folder","test.html"),
os.path.join("sample_data","data","test.css"),
"run.pyc"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

"upload.c",
os.path.join("src", "abc.pyc"),
os.path.join("other_folder","test.html"),
os.path.join("sample_data","data","test.css"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E231 missing whitespace after ',''

PycodestyleBear (E231), severity NORMAL, section autopep8.

"upload.c",
os.path.join("src", "abc.pyc"),
os.path.join("other_folder","test.html"),
os.path.join("sample_data","data","test.css"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E231 missing whitespace after ',''

PycodestyleBear (E231), severity NORMAL, section autopep8.

"upload.c",
os.path.join("src", "abc.pyc"),
os.path.join("other_folder","test.html"),
os.path.join("sample_data","data","test.css"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

"glob2.py",
"upload.c",
os.path.join("src", "abc.pyc"),
os.path.join("other_folder","test.html"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E231 missing whitespace after ',''

PycodestyleBear (E231), severity NORMAL, section autopep8.

"glob2.py",
"upload.c",
os.path.join("src", "abc.pyc"),
os.path.join("other_folder","test.html"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

os.path.join("src", "ignore.c"),
"glob2.py",
"upload.c",
os.path.join("src", "abc.pyc"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

"ignore.c",
os.path.join("src", "ignore.c"),
"glob2.py",
"upload.c",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

os.path.join("src", "build", "main.c"),
"ignore.c",
os.path.join("src", "ignore.c"),
"glob2.py",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

os.path.join("tests", "run.c"),
os.path.join("src", "build", "main.c"),
"ignore.c",
os.path.join("src", "ignore.c"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

ignored_files = [os.path.join("build", "main.c"),
os.path.join("tests", "run.c"),
os.path.join("src", "build", "main.c"),
"ignore.c",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

".coafile"]
ignored_files = [os.path.join("build", "main.c"),
os.path.join("tests", "run.c"),
os.path.join("src", "build", "main.c"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

os.path.join("sample_data", "example.py"),
".coafile"]
ignored_files = [os.path.join("build", "main.c"),
os.path.join("tests", "run.c"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

os.path.join("other_folder", "new_file.c"),
os.path.join("sample_data", "data", "new_script.js"),
os.path.join("sample_data", "example.py"),
".coafile"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

os.path.join("src", "upload.c"),
os.path.join("other_folder", "new_file.c"),
os.path.join("sample_data", "data", "new_script.js"),
os.path.join("sample_data", "example.py"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

os.path.join("src", "abc.py"),
os.path.join("src", "upload.c"),
os.path.join("other_folder", "new_file.c"),
os.path.join("sample_data", "data", "new_script.js"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

os.path.join("src", "tests", "main.c"),
os.path.join("src", "abc.py"),
os.path.join("src", "upload.c"),
os.path.join("other_folder", "new_file.c"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

os.path.join("src", "lib", "ssl.c"),
os.path.join("src", "tests", "main.c"),
os.path.join("src", "abc.py"),
os.path.join("src", "upload.c"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

os.path.join("src", "main.h"),
os.path.join("src", "lib", "ssl.c"),
os.path.join("src", "tests", "main.c"),
os.path.join("src", "abc.py"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

files = [os.path.join("src", "main.c"),
os.path.join("src", "main.h"),
os.path.join("src", "lib", "ssl.c"),
os.path.join("src", "tests", "main.c"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

os.chdir("file_globs_npmignore_testfiles")
files = [os.path.join("src", "main.c"),
os.path.join("src", "main.h"),
os.path.join("src", "lib", "ssl.c"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

os.chdir(os.path.dirname(os.path.realpath(__file__)))
os.chdir("file_globs_npmignore_testfiles")
files = [os.path.join("src", "main.c"),
os.path.join("src", "main.h"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E128 continuation line under-indented for visual indent'

PycodestyleBear (E128), severity NORMAL, section autopep8.

self.log_printer, self.printer, os.getcwd())[0]),
sorted(files))

os.remove(os.path.join("other_folder",".npmignore"))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code does not comply to PEP8.

PEP8Bear, severity NORMAL, section autopep8.

The issue can be fixed by applying the following patch:

--- a/tests/generation/FileGlobs.py
+++ b/tests/generation/FileGlobs.py
@@ -191,7 +191,7 @@
                     self.log_printer, self.printer, os.getcwd())[0]),
                 sorted(files))
 
-        os.remove(os.path.join("other_folder",".npmignore"))
+        os.remove(os.path.join("other_folder", ".npmignore"))
         os.remove(os.path.join("sample_data", "data", ".npmignore"))
         os.remove(".npmignore")
         os.chdir(orig_cwd)

os.path.join(os.getcwd(), "other_folder"),
os.path.join(os.getcwd(), "sample_data", "data")]

globs = list(get_npmignore_glob(os.getcwd(),npmignore_dir_list))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code does not comply to PEP8.

PEP8Bear, severity NORMAL, section autopep8.

The issue can be fixed by applying the following patch:

--- a/tests/generation/FileGlobs.py
+++ b/tests/generation/FileGlobs.py
@@ -174,7 +174,7 @@
                               os.path.join(os.getcwd(), "other_folder"),
                               os.path.join(os.getcwd(), "sample_data", "data")]
 
-        globs = list(get_npmignore_glob(os.getcwd(),npmignore_dir_list))
+        globs = list(get_npmignore_glob(os.getcwd(), npmignore_dir_list))
 
         returned_files = collect_files(
             [os.path.join(os.getcwd(), "**")],

os.chdir(os.path.dirname(os.path.realpath(__file__)))
os.chdir("file_globs_npmignore_testfiles")
files = [os.path.join("src", "main.c"),
os.path.join("src", "main.h"),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code does not comply to PEP8.

PEP8Bear, severity NORMAL, section autopep8.

The issue can be fixed by applying the following patch:

--- a/tests/generation/FileGlobs.py
+++ b/tests/generation/FileGlobs.py
@@ -142,26 +142,26 @@
         os.chdir(os.path.dirname(os.path.realpath(__file__)))
         os.chdir("file_globs_npmignore_testfiles")
         files = [os.path.join("src", "main.c"),
-            os.path.join("src", "main.h"),
-            os.path.join("src", "lib", "ssl.c"),
-            os.path.join("src", "tests", "main.c"),
-            os.path.join("src", "abc.py"),
-            os.path.join("src", "upload.c"),
-            os.path.join("other_folder", "new_file.c"),
-            os.path.join("sample_data", "data", "new_script.js"),
-            os.path.join("sample_data", "example.py"),
-            ".coafile"]
+                 os.path.join("src", "main.h"),
+                 os.path.join("src", "lib", "ssl.c"),
+                 os.path.join("src", "tests", "main.c"),
+                 os.path.join("src", "abc.py"),
+                 os.path.join("src", "upload.c"),
+                 os.path.join("other_folder", "new_file.c"),
+                 os.path.join("sample_data", "data", "new_script.js"),
+                 os.path.join("sample_data", "example.py"),
+                 ".coafile"]
         ignored_files = [os.path.join("build", "main.c"),
-            os.path.join("tests", "run.c"),
-            os.path.join("src", "build", "main.c"),
-            "ignore.c",
-            os.path.join("src", "ignore.c"),
-            "glob2.py",
-            "upload.c",
-            os.path.join("src", "abc.pyc"),
-            os.path.join("other_folder","test.html"),
-            os.path.join("sample_data","data","test.css"),
-            "run.pyc"]
+                         os.path.join("tests", "run.c"),
+                         os.path.join("src", "build", "main.c"),
+                         "ignore.c",
+                         os.path.join("src", "ignore.c"),
+                         "glob2.py",
+                         "upload.c",
+                         os.path.join("src", "abc.pyc"),
+                         os.path.join("other_folder", "test.html"),
+                         os.path.join("sample_data", "data", "test.css"),
+                         "run.pyc"]
 
         for file in files + ignored_files:
             os.makedirs(os.path.dirname(os.path.abspath(file)), exist_ok=True)

open(file, "w").close()
files += [".gitignore"]
files += [os.path.join("other_folder", ".npmignore")]
files += [os.path.join("sample_data", "data", ".npmignore")]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code does not comply to PEP8.

PEP8Bear, severity NORMAL, section autopep8.

The issue can be fixed by applying the following patch:

--- a/tests/generation/FileGlobs.py
+++ b/tests/generation/FileGlobs.py
@@ -171,7 +171,7 @@
             open(file, "w").close()
         files += [".gitignore"]
         files += [os.path.join("other_folder", ".npmignore")]
-        files += [os.path.join("sample_data", "data", ".npmignore")]  
+        files += [os.path.join("sample_data", "data", ".npmignore")]
 
         gitignore_dir_list = [os.path.join(os.getcwd())]
         npmignore_dir_list = [os.path.join(os.getcwd(), "other_folder"),

open(file, "w").close()
files += [".gitignore"]
files += [os.path.join("other_folder", ".npmignore")]
files += [os.path.join("sample_data", "data", ".npmignore")]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line contains following spacing inconsistencies:

  • Trailing whitespaces.

SpaceConsistencyBear, severity NORMAL, section python.

The issue can be fixed by applying the following patch:

--- a/tests/generation/FileGlobs.py
+++ b/tests/generation/FileGlobs.py
@@ -171,7 +171,7 @@
             open(file, "w").close()
         files += [".gitignore"]
         files += [os.path.join("other_folder", ".npmignore")]
-        files += [os.path.join("sample_data", "data", ".npmignore")]  
+        files += [os.path.join("sample_data", "data", ".npmignore")]
 
         gitignore_dir_list = [os.path.join(os.getcwd())]
         npmignore_dir_list = [os.path.join(os.getcwd(), "other_folder"),

files += [os.path.join("other_folder", ".npmignore")]
files += [os.path.join("sample_data", "data", ".npmignore")]

gitignore_dir_list = [os.path.join(os.getcwd())]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file contains unused source code.

PyUnusedCodeBear, severity NORMAL, section python.

The issue can be fixed by applying the following patch:

--- a/tests/generation/FileGlobs.py
+++ b/tests/generation/FileGlobs.py
@@ -173,7 +173,7 @@
         files += [os.path.join("other_folder", ".npmignore")]
         files += [os.path.join("sample_data", "data", ".npmignore")]
 
-        gitignore_dir_list = [os.path.join(os.getcwd())]
+        [os.path.join(os.getcwd())]
         npmignore_dir_list = [os.path.join(os.getcwd(), "other_folder"),
                               os.path.join(os.getcwd(), "sample_data", "data")]
 

@prachi1210 prachi1210 force-pushed the prachi1210/#109 branch 2 times, most recently from 569e7ab to e9ecc9a Compare August 18, 2017 16:48
for file in files + ignored_files:
os.makedirs(os.path.dirname(os.path.abspath(file)), exist_ok=True)
open(file, "w").close()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line contains following spacing inconsistencies:

  • Trailing whitespaces.

SpaceConsistencyBear, severity NORMAL, section python.

The issue can be fixed by applying the following patch:

--- a/tests/generation/FileGlobs.py
+++ b/tests/generation/FileGlobs.py
@@ -168,7 +168,7 @@
         for file in files + ignored_files:
             os.makedirs(os.path.dirname(os.path.abspath(file)), exist_ok=True)
             open(file, "w").close()
-        
+
         files += [os.path.join("other_folder", ".npmignore")]
         files += [os.path.join("sample_data", "data", ".npmignore")]
 

for file in files + ignored_files:
os.makedirs(os.path.dirname(os.path.abspath(file)), exist_ok=True)
open(file, "w").close()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

W293 blank line contains whitespace'

PycodestyleBear (W293), severity NORMAL, section autopep8.

for file in files + ignored_files:
os.makedirs(os.path.dirname(os.path.abspath(file)), exist_ok=True)
open(file, "w").close()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code does not comply to PEP8.

PEP8Bear, severity NORMAL, section autopep8.

The issue can be fixed by applying the following patch:

--- a/tests/generation/FileGlobs.py
+++ b/tests/generation/FileGlobs.py
@@ -168,7 +168,7 @@
         for file in files + ignored_files:
             os.makedirs(os.path.dirname(os.path.abspath(file)), exist_ok=True)
             open(file, "w").close()
-        
+
         files += [os.path.join("other_folder", ".npmignore")]
         files += [os.path.join("sample_data", "data", ".npmignore")]
 

@prachi1210 prachi1210 force-pushed the prachi1210/#109 branch 2 times, most recently from 9236101 to ac83598 Compare August 18, 2017 16:59

globs = get_npmignore_glob(project_dir, npmignore_dir_list)
for glob in globs:
ignore_globs += glob

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code does not comply to PEP8.

PEP8Bear, severity NORMAL, section autopep8.

The issue can be fixed by applying the following patch:

--- a/coala_quickstart/generation/FileGlobs.py
+++ b/coala_quickstart/generation/FileGlobs.py
@@ -45,7 +45,7 @@
 
     globs = get_npmignore_glob(project_dir, npmignore_dir_list)
     for glob in globs:
-            ignore_globs += glob
+        ignore_globs += glob
 
     if non_interactive and not ignore_globs:
         ignore_globs = []


globs = get_npmignore_glob(project_dir, npmignore_dir_list)
for glob in globs:
ignore_globs += glob

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code does not comply to PEP8.

PEP8Bear, severity NORMAL, section autopep8.

The issue can be fixed by applying the following patch:

--- a/coala_quickstart/generation/FileGlobs.py
+++ b/coala_quickstart/generation/FileGlobs.py
@@ -45,7 +45,7 @@
 
     globs = get_npmignore_glob(project_dir, npmignore_dir_list)
     for glob in globs:
-            ignore_globs += glob
+        ignore_globs += glob
 
     if non_interactive and not ignore_globs:
         ignore_globs = []

@prachi1210 prachi1210 force-pushed the prachi1210/#109 branch 2 times, most recently from 9cd63ea to f1b6ed5 Compare August 18, 2017 17:05
Looks for .npmignore in dirs and subdirs recursively
and extract file globs

Closes coala#109
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants