Skip to content

Commit

Permalink
Merge pull request #3147 from mirpedrol/module-pipeline-same-name
Browse files Browse the repository at this point in the history
Linting: handle cases where the directory path contains the name of the component
  • Loading branch information
mirpedrol committed Aug 29, 2024
2 parents 4e385ab + 847fe0b commit 3d475d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
- Linting will now check if the schema is correct for the used validation plugin ([#3116])(https://github.com/nf-core/tools/pull/3116)
- Linting will now check the use of the right validation plugin include statements in the workflow scripts ([#3116])(https://github.com/nf-core/tools/pull/3116)
- Full linting for correct use of nf-schema and nf-validation ([#3116](https://github.com/nf-core/tools/pull/3116))
- Handle cases where the directory path contains the name of the component ([#3147](https://github.com/nf-core/tools/pull/3147))

### Pipeline create command

Expand Down
7 changes: 6 additions & 1 deletion nf_core/components/nfcore_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ def __init__(
self.process_name = ""
self.environment_yml: Optional[Path] = Path(self.component_dir, "environment.yml")

repo_dir = self.component_dir.parts[: self.component_dir.parts.index(self.component_name.split("/")[0])][-1]
name_index = (
len(self.component_dir.parts)
- 1
- self.component_dir.parts[::-1].index(self.component_name.split("/")[0])
)
repo_dir = self.component_dir.parts[:name_index][-1]
self.org = repo_dir
self.nftest_testdir = Path(self.component_dir, "tests")
self.nftest_main_nf = Path(self.nftest_testdir, "main.nf.test")
Expand Down

0 comments on commit 3d475d5

Please sign in to comment.