Skip to content

Commit

Permalink
Merge pull request #65 from seqeralabs/ECLINT
Browse files Browse the repository at this point in the history
Fix Eclint
  • Loading branch information
drpatelh authored Oct 23, 2024
2 parents e85cb21 + a832d10 commit 08a907f
Show file tree
Hide file tree
Showing 8 changed files with 178 additions and 215 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ indent_size = unset
# ignore python and markdown
[*.{py,md}]
indent_style = unset

# ignore multiqc example
[/assets/multiqc_report.html]
indent_style = unset
58 changes: 9 additions & 49 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,61 +11,21 @@ on:
types: [published]

jobs:
EditorConfig:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4

- uses: actions/setup-node@v3

- name: Install editorconfig-checker
run: npm install -g editorconfig-checker

- name: Run ECLint check
run: editorconfig-checker -exclude README.md $(find .* -type f | grep -v '.git\|.py\|.md\|json\|yml\|yaml\|html\|css\|work\|.nextflow\|build\|nf_core.egg-info\|log.txt\|Makefile')

Prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3

- name: Install Prettier
run: npm install -g prettier

- name: Run Prettier --check
run: prettier --check ${GITHUB_WORKSPACE}

PythonBlack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Check code lints with Black
uses: psf/black@stable

# If the above check failed, post a comment on the PR explaining the failure
- name: Post PR comment
if: failure()
uses: mshick/add-pr-comment@v1
- name: Set up Python 3.12
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
with:
message: |
## Python linting (`black`) is failing
To keep the code consistent with lots of contributors, we run automated code consistency checks.
To fix this CI test, please run:
* Install [`black`](https://black.readthedocs.io/en/stable/): `pip install black`
* Fix formatting errors in your pipeline: `black .`
Once you push these changes the test should pass, and you can hide this comment :+1:
python-version: "3.12"

We highly recommend setting up Black in your code editor so that this formatting is done automatically on save. Ask about it on Slack for help!
- name: Install pre-commit
run: pip install pre-commit

Thanks again for your contribution!
repo-token: ${{ secrets.GITHUB_TOKEN }}
allow-repeats: false
- name: Run pre-commit
run: pre-commit run --all-files

nf-core:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Thank you to everyone else that has contributed by reporting bugs, enhancements

[PR #61](https://github.com/seqeralabs/nf-aggregate/pull/61) - Remove dependency on external library/grape
[PR #63](https://github.com/seqeralabs/nf-aggregate/pull/63) - Add `maxForks` setting for Seqera CLI to overcome API issues
[PR #65](https://github.com/seqeralabs/nf-aggregate/pull/65) - Replace eclint GHA by pre-commit

## [[0.4.0](https://github.com/seqeralabs/nf-aggregate/releases/tag/0.4.0)] - 2024-07-26

Expand Down
314 changes: 157 additions & 157 deletions assets/multiqc_report.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/local/plot_run_gantt/nextflow.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ process {
saveAs: { filename -> filename.equals('versions.yml') ? null : filename }
]
}
}
}
6 changes: 3 additions & 3 deletions subworkflows/local/utils_nf_aggregate/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def getWorkflowPublishDir(json_file, outdir) {
def workdir = getWorkflowWorkDir(json_file)
if (workdir.startsWith('s3://')) {
path = Paths.get(workdir, path)
}
}
}
return path
}
Expand All @@ -99,8 +99,8 @@ def getProcessVersions(yaml_file) {
def getWorkflowVersions() {
return """
'Workflow':
"Nextflow": "$workflow.nextflow.version"
"$workflow.manifest.name": "$workflow.manifest.version"
"Nextflow": "$workflow.nextflow.version"
"$workflow.manifest.name": "$workflow.manifest.version"
""".stripIndent().trim()
}

Expand Down
6 changes: 2 additions & 4 deletions subworkflows/local/utils_nf_aggregate/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ nextflow_workflow {

tag "subworkflows"
tag "subworkflows_local_utils_nf_aggregate"

stage {
symlink "nextflow_schema.json"
symlink "workflows/nf_aggregate/assets/test_run_ids.csv"
Expand All @@ -28,10 +28,8 @@ nextflow_workflow {
{ assert workflow.success },
{ assert snapshot(
workflow.out.ids
).match() }
).match() }
)
}

}

}
2 changes: 1 addition & 1 deletion workflows/nf_aggregate/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
includeConfig '../../modules/local/seqera_runs_dump/nextflow.config'
includeConfig '../../modules/local/plot_run_gantt/nextflow.config'
includeConfig '../../modules/nf-core/multiqc/nextflow.config'
includeConfig '../../modules/nf-core/multiqc/nextflow.config'

0 comments on commit 08a907f

Please sign in to comment.