Skip to content

Commit

Permalink
Merge pull request #920 from KevinMenden/path-fix-triage-2
Browse files Browse the repository at this point in the history
Path fix triage 2
  • Loading branch information
ewels authored Mar 19, 2021
2 parents ccd9ef1 + e0c22bb commit 5e032b4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions nf_core/modules/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,10 @@ def get_installed_modules(self):
# Get nf-core modules
if os.path.exists(nfcore_modules_dir):
for m in sorted([m for m in os.listdir(nfcore_modules_dir) if not m == "lib"]):
if not os.path.isdir(os.path.join(nfcore_modules_dir, m)):
raise ModuleLintException(
f"File found in '{nfcore_modules_dir}': '{m}'! This directly should only contain module directories."
)
m_content = os.listdir(os.path.join(nfcore_modules_dir, m))
# Not a module, but contains sub-modules
if not "main.nf" in m_content:
Expand Down Expand Up @@ -289,8 +293,8 @@ def format_result(test_results, table):
last_modname = mod.module_name
table.add_row(
Markdown(f"{mod.module_name}"),
Markdown(f"{result[1]}"),
os.path.relpath(result[2], self.dir),
Markdown(f"{result[1]}"),
style=row_style,
)
return table
Expand All @@ -307,8 +311,8 @@ def _s(some_list):
)
table = Table(style="green", box=rich.box.ROUNDED)
table.add_column("Module name", width=max_mod_name_len)
table.add_column("Test message", no_wrap=True)
table.add_column("File path", no_wrap=True)
table.add_column("Test message")
table = format_result(self.passed, table)
console.print(table)

Expand All @@ -321,8 +325,8 @@ def _s(some_list):
)
table = Table(style="yellow", box=rich.box.ROUNDED)
table.add_column("Module name", width=max_mod_name_len)
table.add_column("Test message", no_wrap=True)
table.add_column("File path", no_wrap=True)
table.add_column("Test message")
table = format_result(self.warned, table)
console.print(table)

Expand All @@ -333,8 +337,8 @@ def _s(some_list):
)
table = Table(style="red", box=rich.box.ROUNDED)
table.add_column("Module name", width=max_mod_name_len)
table.add_column("Test message", no_wrap=True)
table.add_column("File path", no_wrap=True)
table.add_column("Test message")
table = format_result(self.failed, table)
console.print(table)

Expand Down

0 comments on commit 5e032b4

Please sign in to comment.