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
Make lint run when directories are passed in #9995
Changes from 3 commits
38c57ab
0970b16
6876362
66327df
8b4d699
9946332
bcfb88c
b487ee4
7eebf5e
3ebdf61
6035666
cd40045
7f0b2a7
6a4ad27
48ebbba
823d126
d426f8c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -747,8 +747,21 @@ def changed_files(wpt_root): | |
|
||
def lint_paths(kwargs, wpt_root): | ||
if kwargs.get("paths"): | ||
r = os.path.realpath(wpt_root) | ||
paths = [os.path.relpath(os.path.realpath(x), r) for x in kwargs["paths"]] | ||
#make new list in case there are multiple added directories | ||
paths=[] | ||
for path in kwargs.get("paths"): | ||
if os.path.isdir(path): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this |
||
# create extension for called directory and merge it with the existing path | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This indent is wrong. |
||
new_Path = os.path.realpath(os.path.join(wpt_root, path)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Variable names should be all lowercase. |
||
extension = path+'/' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this should use |
||
# get all files from new path | ||
path_dir = list(all_filesystem_paths(new_Path)) | ||
# add the extension to the strings for all files from the new path, | ||
# so they may be called from the current directory | ||
paths = [extension + extended_path for extended_path in path_dir] | ||
# add all files from a given directory to our master list of files to check | ||
paths=paths+path_dir | ||
|
||
elif kwargs["all"]: | ||
paths = list(all_filesystem_paths(wpt_root)) | ||
else: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spaces between operators and operands, please.