Skip to content

Commit

Permalink
Merge branch 'dev' into initial-git-branch-setting
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianegli authored Oct 20, 2022
2 parents 3bbc558 + 6cd9134 commit b4789a6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 3 deletions.
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 @@ -167,6 +167,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.")
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")
default_branch = "master"
self.create_obj = nf_core.create.PipelineCreate(
"testing", "test pipeline", "tester", outdir=self.pipeline_dir, plain=True, default_branch=default_branch
Expand Down

0 comments on commit b4789a6

Please sign in to comment.