Skip to content

Commit

Permalink
Manage relative paths of files in sub directories
Browse files Browse the repository at this point in the history
  • Loading branch information
nvuillam committed Sep 15, 2022
1 parent cde68ce commit 62d1ae5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions megalinter/MegaLinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ def collect_files(self):
file_extensions=self.file_extensions,
ignored_files=ignored_files,
ignore_generated_files=self.ignore_generated_files,
workspace=self.workspace
workspace=self.workspace,
)

logging.info(
Expand Down Expand Up @@ -683,9 +683,12 @@ def list_files_all(self):
if logging.getLogger().isEnabledFor(logging.DEBUG):
logging.debug("Root dir content:" + utils.format_bullet_list(all_files))
excluded_directories = utils.get_excluded_directories()
for (_dirpath, dirnames, filenames) in os.walk(self.workspace, topdown=True):
for (dirpath, dirnames, filenames) in os.walk(self.workspace, topdown=True):
dirnames[:] = [d for d in dirnames if d not in excluded_directories]
all_files += sorted(filenames)
all_files += [
os.path.relpath(os.path.join(dirpath, file), self.workspace)
for file in sorted(filenames)
]
return list(dict.fromkeys(all_files))

def list_git_ignored_files(self):
Expand Down

0 comments on commit 62d1ae5

Please sign in to comment.