Add more ruff rules (B, PTH, RSE, SIM, C4, BLE, A)#4034
Add more ruff rules (B, PTH, RSE, SIM, C4, BLE, A)#4034mashehu wants to merge 58 commits intonf-core:devfrom
Conversation
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8dac8db to
b53e971
Compare
a84464a to
084389c
Compare
|
hah, looks like most of these new rules are anyway part of an upcoming set of default ruff rules: astral-sh/ruff#23203 |
b2cd1b3 to
dada220
Compare
nf_core/synced_repo.py
Outdated
| """ | ||
| dir_names = os.listdir(self.local_repo_dir) | ||
| if "modules" not in dir_names: | ||
| assert self.local_repo_dir is not None, "Repository must be initialized before verifying branch" |
There was a problem hiding this comment.
assert outside test code should be avoided. See #1533 for reference.
nf_core/modules/modules_utils.py
Outdated
|
|
||
| # Remove the file extension from the path | ||
| path, _ = os.path.splitext(path) | ||
| path = str(Path(path).with_suffix("")) |
There was a problem hiding this comment.
This could be .stem.
Sidenote: The variable path is reassigned. A new variable with the name full_name or something similar would be more descriptive and fit the function better.
There was a problem hiding this comment.
Looking into it, and I don't think that .stem would be the same here. we want to have nf-core/modules as a full_name for example, where .stem would give us just modules
Path().open is just a wrapper around open() and so doesn't add anything
# Conflicts: # CHANGELOG.md # Conflicts: # CHANGELOG.md # Conflicts: # CHANGELOG.md
Additional rules we could add: