mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1708592 - Normalize paths when filtering in clippy and rustfmt lints. r=sylvestre
Without normalization, the paths don't match the filters on Windows. Differential Revision: https://phabricator.services.mozilla.com/D113904
This commit is contained in:
parent
2badf48dc0
commit
c2a87c9b07
@ -39,6 +39,8 @@ And make sure that it is in the PATH
|
||||
|
||||
def parse_issues(log, config, issues, path, onlyIn):
|
||||
results = []
|
||||
if onlyIn:
|
||||
onlyIn = os.path.normcase(os.path.normpath(onlyIn))
|
||||
for issue in issues:
|
||||
|
||||
try:
|
||||
@ -70,7 +72,7 @@ def parse_issues(log, config, issues, path, onlyIn):
|
||||
continue
|
||||
|
||||
l = detail["spans"][0]
|
||||
if onlyIn and onlyIn not in p:
|
||||
if onlyIn and onlyIn not in os.path.normcase(os.path.normpath(p)):
|
||||
# Case when we have a .rs in the include list in the yaml file
|
||||
log.debug(
|
||||
"{} is not part of the list of files '{}'".format(p, onlyIn)
|
||||
|
@ -60,13 +60,14 @@ def parse_issues(config, output, paths):
|
||||
diff += line + "\n"
|
||||
# the algorithm above will always skip adding the last issue
|
||||
issues.append(RustfmtDiff(file, line_no, diff))
|
||||
file = os.path.normcase(os.path.normpath(file))
|
||||
results = []
|
||||
for issue in issues:
|
||||
# rustfmt can not be supplied the paths to the files we want to analyze
|
||||
# therefore, for each issue detected, we check if any of the the paths
|
||||
# supplied are part of the file name.
|
||||
# This just filters out the issues that are not part of paths.
|
||||
if any([path in file for path in paths]):
|
||||
if any([os.path.normcase(os.path.normpath(path)) in file for path in paths]):
|
||||
res = {
|
||||
"path": issue.file,
|
||||
"diff": issue.diff,
|
||||
|
Loading…
Reference in New Issue
Block a user