Skip to content

Commit

Permalink
Merge pull request #3366 from mirpedrol/update-license-linting
Browse files Browse the repository at this point in the history
Template: set LICENSE copyright to nf-core community
  • Loading branch information
mirpedrol authored Dec 20, 2024
2 parents fe5c5ac + 304728c commit a0cdd41
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@

- Use outputs instead of the environment to pass around values between steps in the Download Test Action ([#3351](https://github.com/nf-core/tools/pull/3351))
- Fix pre commit template ([#3358](https://github.com/nf-core/tools/pull/3358))
- Set LICENSE copyright to nf-core community ([#3366](https://github.com/nf-core/tools/pull/3366))

### Download

### Linting

- Linting of pipeline LICENSE file is a warning to allow for author/maintainer names ([#3366](https://github.com/nf-core/tools/pull/3366))

### Modules

- fix including modules.config ([#3356](https://github.com/nf-core/tools/pull/3356))
Expand Down
2 changes: 1 addition & 1 deletion nf_core/pipeline-template/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) {{ author }}
Copyright (c) {% if is_nfcore %} The nf-core community {% else %} The {{ short_name }} team {% endif %}

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
16 changes: 15 additions & 1 deletion nf_core/pipelines/lint/files_unchanged.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def files_unchanged(self) -> Dict[str, Union[List[str], bool]]:

passed: List[str] = []
failed: List[str] = []
warned: List[str] = []
ignored: List[str] = []
fixed: List[str] = []
could_fix: bool = False
Expand Down Expand Up @@ -173,6 +174,12 @@ def _tf(file_path: Union[str, Path]) -> Path:
shutil.copy(_tf(f), _pf(f))
passed.append(f"`{f}` matches the template")
fixed.append(f"`{f}` overwritten with template file")
elif f.name in ["LICENSE", "LICENSE.md", "LICENCE", "LICENCE.md"]:
# Report LICENSE as a warning since we are not using the manifest.author names
# TODO: Lint the content of the LICENSE file except the line containing author names
# to allow for people to opt-in listing author/maintainer names instead of using the "nf-core community"
warned.append(f"`{f}` does not match the template")
could_fix = True
else:
failed.append(f"`{f}` does not match the template")
could_fix = True
Expand Down Expand Up @@ -217,4 +224,11 @@ def _tf(file_path: Union[str, Path]) -> Path:
# cleaning up temporary dir
shutil.rmtree(tmp_dir)

return {"passed": passed, "failed": failed, "ignored": ignored, "fixed": fixed, "could_fix": could_fix}
return {
"passed": passed,
"failed": failed,
"warned": warned,
"ignored": ignored,
"fixed": fixed,
"could_fix": could_fix,
}

0 comments on commit a0cdd41

Please sign in to comment.