diff --git a/nf_core/modules/lint.py b/nf_core/modules/lint.py index 59229cffcd..beade12c99 100644 --- a/nf_core/modules/lint.py +++ b/nf_core/modules/lint.py @@ -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: @@ -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 @@ -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) @@ -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) @@ -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)