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

dev -> main for 3.1.2 #3406

Merged
merged 68 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
390c03a
bump to 3.2.0dev
mirpedrol Dec 20, 2024
40fa26e
[automated] Update CHANGELOG.md
nf-core-bot Dec 20, 2024
20de879
fix trailing spaces in conf/test.config
mirpedrol Dec 20, 2024
3cb8775
run pre-comit when rendering template for pipelines sync
mirpedrol Dec 20, 2024
6b43881
add newline
mirpedrol Dec 20, 2024
4bd4d23
bump to 3.1.2dev
mirpedrol Dec 20, 2024
bf3224c
Allow downloading a specific commit ID
muffato Dec 20, 2024
9dcb4a0
Added tests
fellen31 Apr 4, 2024
7b931f1
Added more tests
muffato Dec 20, 2024
c356337
Updated the changelog
muffato Dec 20, 2024
b0b9559
Added some documentation
muffato Dec 20, 2024
132d09c
Update pre-commit hook pre-commit/mirrors-mypy to v1.14.1
renovate[bot] Jan 1, 2025
6fe8f28
Update pre-commit hook astral-sh/ruff-pre-commit to v0.8.6
renovate[bot] Jan 4, 2025
340523c
Merge pull request #3370 from mirpedrol/bump-3.2.0dev
mirpedrol Jan 7, 2025
12f6e36
Merge branch 'dev' into download_commits
mirpedrol Jan 7, 2025
a335212
only append module name if it is a dir and contains main.nf
mirpedrol Jan 7, 2025
983dced
update changelog
mirpedrol Jan 7, 2025
e0d8732
Merge branch 'dev' into renovate/pre-commit-mirrors-mypy-1.x
mashehu Jan 7, 2025
069fce2
add tests for get_installed_modules() utils function
mirpedrol Jan 7, 2025
19070e5
remove type hint to make mypy pass
mashehu Jan 7, 2025
72f2ed1
Merge branch 'dev' into renovate/astral-sh-ruff-pre-commit-0.x
mashehu Jan 7, 2025
53703f4
Merge pull request #3384 from mirpedrol/modules-bump-versions
mirpedrol Jan 7, 2025
21222f4
Merge pull request #3376 from nf-core/renovate/astral-sh-ruff-pre-com…
mashehu Jan 7, 2025
73ee4a1
Merge pull request #3379 from nf-core/renovate/pre-commit-mirrors-myp…
mashehu Jan 7, 2025
011d15a
Update python:3.12-slim Docker digest to 10f3aaa (#3381)
renovate[bot] Jan 7, 2025
4a74d5b
remove required from oneOf, allOf and anyOf instances in a schema
mirpedrol Jan 8, 2025
5782edf
print complete error message from schema validation on debug
mirpedrol Jan 8, 2025
958f58e
[automated] Update CHANGELOG.md
nf-core-bot Jan 8, 2025
51fba5a
reduce code
mirpedrol Jan 8, 2025
2f2950f
handle anyOf, allOf, oneOf in top level
mirpedrol Jan 8, 2025
b1c7a8c
add tests for validate_default_params function
mirpedrol Jan 8, 2025
824fa8f
Update ci.yml
sateeshperi Jan 8, 2025
63aff6e
Merge branch 'dev' into sateeshperi-patch-1
sateeshperi Jan 8, 2025
40c77c7
Merge pull request #3388 from nf-core/sateeshperi-patch-1
maxulysse Jan 8, 2025
b685800
Merge pull request #3386 from mirpedrol/schema-allow-oneof-anyof-allof
mirpedrol Jan 9, 2025
9cc2b5b
Merge branch 'dev' into run-prettier-on-sync
mirpedrol Jan 13, 2025
80e06dc
do not run pre-commit if we are not on a git repo
mirpedrol Jan 13, 2025
d4d3f36
Merge pull request #3371 from mirpedrol/run-prettier-on-sync
mirpedrol Jan 13, 2025
a7aee9c
Factored out the commit ID
muffato Jan 13, 2025
1844f55
Not needed
muffato Jan 13, 2025
5ae7d53
Factored out the commit ID
muffato Jan 13, 2025
62c3c2b
Factored out the commit ID
muffato Jan 13, 2025
570ae2b
Merge remote-tracking branch 'origin/dev' into download_commits
muffato Jan 13, 2025
f58510f
Merge pull request #3374 from nf-core/download_commits
muffato Jan 13, 2025
16dd8d5
Reorganise download test to ensure setup and download are executed on…
MatthiasZepper Jan 8, 2025
2184cab
Add explicit container cache inspection to action.
MatthiasZepper Jan 8, 2025
737b515
Changelog.
MatthiasZepper Jan 8, 2025
65969d9
Merge pull request #3389 from MatthiasZepper/no_env_in_download_action
MatthiasZepper Jan 13, 2025
df41fc0
fix sync GHA by removing quotes from parsed branch name
mirpedrol Jan 14, 2025
ed1cbde
[automated] Update CHANGELOG.md
nf-core-bot Jan 14, 2025
4bdf77e
make rocrate no git info message a debug message to avoid seeing it e…
mirpedrol Jan 14, 2025
225b0b7
manifest.authors is not mandatory anymore
mirpedrol Jan 14, 2025
7641e5f
[automated] Update CHANGELOG.md
nf-core-bot Jan 14, 2025
6680f41
Merge pull request #3397 from mirpedrol/make-author-not-required
mirpedrol Jan 15, 2025
24e6c80
Merge branch 'dev' into fix-sync-gha
mirpedrol Jan 15, 2025
7fa5d5b
Merge pull request #3394 from mirpedrol/fix-sync-gha
mirpedrol Jan 15, 2025
cd72f97
update nf-schema version
nvnieuwk Jan 15, 2025
e62a94b
update changelog
nvnieuwk Jan 15, 2025
e6402db
Merge pull request #3401 from nvnieuwk/update-nf-schema
nvnieuwk Jan 16, 2025
bd5c641
bump version to 3.1.2
mirpedrol Jan 20, 2025
373ad61
remove jinja formatting which was deleting line breaks
mirpedrol Jan 20, 2025
4746cfd
Merge pull request #3405 from mirpedrol/fix-jinja
mirpedrol Jan 20, 2025
ce69545
Merge branch 'dev' into bump-3.1.2
mirpedrol Jan 20, 2025
c1ab12f
Merge pull request #3404 from mirpedrol/bump-3.1.2
mirpedrol Jan 20, 2025
53d0e33
changelog updates
mirpedrol Jan 20, 2025
112bf2b
Merge pull request #3407 from mirpedrol/changelog
mirpedrol Jan 20, 2025
d113f24
update release date [skip ci]
mirpedrol Jan 20, 2025
e481084
Merge pull request #3408 from mirpedrol/update-date
mirpedrol Jan 20, 2025
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
Prev Previous commit
Next Next commit
do not run pre-commit if we are not on a git repo
  • Loading branch information
mirpedrol committed Jan 13, 2025
commit 80e06dcbeb197c66683d66b6bb8ab663fd2a0a39
1 change: 1 addition & 0 deletions nf_core/pipelines/create/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ def render_template(self) -> None:
log.debug(f"Dumping pipeline template yml to pipeline config file '{config_fn.name}'")

# Run prettier on files for pipelines sync
log.debug("Running prettier on pipeline files")
run_prettier_on_file([str(f) for f in self.outdir.glob("**/*")])

def fix_linting(self):
Expand Down
44 changes: 29 additions & 15 deletions nf_core/pipelines/lint_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ def print_fixes(lint_obj):
)


def check_git_repo() -> bool:
"""Check if the current directory is a git repository."""
try:
subprocess.check_output(["git", "rev-parse", "--is-inside-work-tree"])
return True
except subprocess.CalledProcessError:
return False


def run_prettier_on_file(file: Union[Path, str, List[str]]) -> None:
"""Run the pre-commit hook prettier on a file.

Expand All @@ -80,28 +89,33 @@ def run_prettier_on_file(file: Union[Path, str, List[str]]) -> None:
If Prettier is not installed, a warning is logged.
"""

is_git = check_git_repo()

nf_core_pre_commit_config = Path(nf_core.__file__).parent / ".pre-commit-prettier-config.yaml"
args = ["pre-commit", "run", "--config", str(nf_core_pre_commit_config), "prettier"]
if isinstance(file, List):
args.extend(["--files", *file])
else:
args.extend(["--files", str(file)])

try:
subprocess.run(args, capture_output=True, check=True)
log.debug(f"${subprocess.STDOUT}")
except subprocess.CalledProcessError as e:
if ": SyntaxError: " in e.stdout.decode():
log.critical(f"Can't format {file} because it has a syntax error.\n{e.stdout.decode()}")
elif "files were modified by this hook" in e.stdout.decode():
all_lines = [line for line in e.stdout.decode().split("\n")]
files = "\n".join(all_lines[3:])
log.debug(f"The following files were modified by prettier:\n {files}")
else:
log.warning(
"There was an error running the prettier pre-commit hook.\n"
f"STDOUT: {e.stdout.decode()}\nSTDERR: {e.stderr.decode()}"
)
if is_git:
try:
proc = subprocess.run(args, capture_output=True, check=True)
log.debug(f"{proc.stdout.decode()}")
except subprocess.CalledProcessError as e:
if ": SyntaxError: " in e.stdout.decode():
log.critical(f"Can't format {file} because it has a syntax error.\n{e.stdout.decode()}")
elif "files were modified by this hook" in e.stdout.decode():
all_lines = [line for line in e.stdout.decode().split("\n")]
files = "\n".join(all_lines[3:])
log.debug(f"The following files were modified by prettier:\n {files}")
else:
log.warning(
"There was an error running the prettier pre-commit hook.\n"
f"STDOUT: {e.stdout.decode()}\nSTDERR: {e.stderr.decode()}"
)
else:
log.debug("Not in a git repository, skipping pre-commit hook.")


def dump_json_with_prettier(file_name, file_content):
Expand Down
Loading