Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom name #1822

Merged
merged 7 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Template

- Fix lint warnings for `samplesheet_check.nf` module
- Check that the workflow name provided with a template doesn't contain dashes ([#1822](https://github.com/nf-core/tools/pull/1822))

### Linting

Expand Down
5 changes: 5 additions & 0 deletions nf_core/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ def create_param_dict(self, name, description, author, version, template_yaml_pa
param_dict["logo_dark"] = f"{param_dict['name_noslash']}_logo_dark.png"
param_dict["version"] = version

# Check that the pipeline name matches the requirements
if not re.match(r"^[a-z]+$", param_dict["short_name"]):
log.error("[red]Invalid workflow name: must be lowercase without punctuation.")
mirpedrol marked this conversation as resolved.
Show resolved Hide resolved
sys.exit(1)

return param_dict, skip_paths

def customize_template(self, template_areas):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def test_make_pipeline_schema(self, tmp_path):
"""Create a workflow, but delete the schema file, then try to load it"""
test_pipeline_dir = os.path.join(tmp_path, "wf")
create_obj = nf_core.create.PipelineCreate(
"test_pipeline", "", "", outdir=test_pipeline_dir, no_git=True, plain=True
"testpipeline", "", "", outdir=test_pipeline_dir, no_git=True, plain=True
)
create_obj.init_pipeline()
os.remove(os.path.join(test_pipeline_dir, "nextflow_schema.json"))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def setUp(self):
self.tmp_dir = tempfile.mkdtemp()
self.template_dir = os.path.join(self.tmp_dir, "wf")
create_obj = nf_core.create.PipelineCreate(
"test_pipeline", "", "", outdir=self.template_dir, no_git=True, plain=True
"testpipeline", "", "", outdir=self.template_dir, no_git=True, plain=True
)
create_obj.init_pipeline()

Expand Down
2 changes: 1 addition & 1 deletion tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class TestModules(unittest.TestCase):
def setUp(self):
"""Create a new pipeline to test"""
self.tmp_dir = tempfile.mkdtemp()
self.pipeline_dir = os.path.join(self.tmp_dir, "test_pipeline")
self.pipeline_dir = os.path.join(self.tmp_dir, "testpipeline")
self.create_obj = nf_core.create.PipelineCreate(
"testing", "test pipeline", "tester", outdir=self.pipeline_dir, plain=True
)
Expand Down