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

Use prettier #1470

Merged
merged 35 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
66b1409
Add Prettier, update actions linting workflows
ewels Mar 17, 2022
2584cbd
Ignore built API docs
ewels Mar 17, 2022
0d0a7e4
Ignore the templates because of jinja2 tags
ewels Mar 17, 2022
7dbe68c
Actions CI: add a module to the empty template pipeline
ewels Mar 17, 2022
0c0aac4
Remove config files for markdownlint and yamllint
ewels Mar 17, 2022
5f80b6f
Run prettier
ewels Mar 17, 2022
0786955
Nicer workflow name
ewels Mar 17, 2022
48b58d9
Resolve merge conflicts
ewels Mar 17, 2022
81bf944
Prettier: ignore testing directory
ewels Mar 17, 2022
756ffeb
Run new compiled pipeline linting commands in the correct directory
ewels Mar 17, 2022
847ca2a
Add .prettierrc.yaml to the pipeline-template
ewels Mar 17, 2022
23d33ca
Remove yamllint and markdownlint configs from the pipeline template
ewels Mar 17, 2022
73f4ff2
Run prettier on the pipeline template folder
ewels Mar 17, 2022
a53ebfb
Manually fix remaining prettier errors in template files that won't c…
ewels Mar 17, 2022
181c9bb
Template: Remove old linting, add Prettier linting CI
ewels Mar 17, 2022
8e6bbd8
Try to move templating logic to make YAML files valid.
ewels Mar 17, 2022
70c27cc
Simpler workaround for CI tests by just using YAML quotes
ewels Mar 17, 2022
5736a05
Work around Prettier auto-formatting in pipeline readme
ewels Mar 17, 2022
861555b
Trailing whitespace after jinja2 tags
ewels Mar 17, 2022
6acf5d5
Update nf-core pipeline lint tests
ewels Mar 17, 2022
9a81137
yaml/yml typo
ewels Mar 17, 2022
cfb217f
.prettierrc yaml -> yml
ewels Mar 17, 2022
fb5211a
Update modules before running nf-core lint
ewels Mar 17, 2022
3691805
Don't test pipeline template with black
ewels Mar 17, 2022
6e60a8d
Move sync test to before we change anything
ewels Mar 17, 2022
04a3b8e
YAML quotes for prettier + jinja parsing
ewels Mar 17, 2022
7841b4a
Fix obscure bug that was breaking pytest
ewels Mar 17, 2022
bf9e7af
build(gitpod): Swap markdownlint for prettier
edmundmiller Mar 18, 2022
207d7c6
style(editorconfig): Use 2 spaces for markdown
edmundmiller Mar 18, 2022
24e022c
Change indentation rules to minimise diffs
ewels Mar 18, 2022
d668dd2
Reformat JSON to 4 spaces with prettier
ewels Mar 18, 2022
1405d48
Update custom/dumpsoftwareversions module
ewels Mar 18, 2022
3d07d69
Fix new MultiQC linting for report comment
ewels Mar 18, 2022
06275d1
Use .editorconfig for indentation config
ewels Mar 18, 2022
a6dbdb1
Add a default for params.outdir on the test config
ewels Mar 18, 2022
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
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_size = 4
indent_style = space

[*.{md,yml,yaml,html,css,scss,js}]
indent_size = 2
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ If you'd like to write some code for nf-core/tools, the standard workflow
is as follows:

1. Check that there isn't [already an issue](https://github.com/nf-core/tools/issues) about your idea to avoid duplicating work.
* If there isn't one already, please create one so that others know you're working on this
- If there isn't one already, please create one so that others know you're working on this
2. Fork the [nf-core/tools repository](https://github.com/nf-core/tools) to your GitHub account
3. Make the necessary changes / additions within your forked repository
4. Submit a Pull Request against the `dev` branch and wait for the code to be reviewed and merged.
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Bug report
description: Report something that is broken or incorrect
labels: bug
body:

- type: markdown
attributes:
value: |
Expand Down
8 changes: 4 additions & 4 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Learn more about contributing: https://github.com/nf-core/tools/tree/master/.git

## PR checklist

- [ ] This comment contains a description of changes (with reason)
- [ ] `CHANGELOG.md` is updated
- [ ] If you've fixed a bug or added code that should be tested, add tests!
- [ ] Documentation in `docs` is updated
- [ ] This comment contains a description of changes (with reason)
- [ ] `CHANGELOG.md` is updated
- [ ] If you've fixed a bug or added code that should be tested, add tests!
- [ ] Documentation in `docs` is updated
6 changes: 3 additions & 3 deletions .github/RELEASE_CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
## Before release

1. Check issue milestones to see outstanding issues to resolve if possible or transfer to the milestones for the next release e.g. [`v1.9`](https://github.com/nf-core/tools/issues?q=is%3Aopen+is%3Aissue+milestone%3A1.9)
2. Most importantly, pick an undeniably outstanding [name](http://www.codenamegenerator.com/) for the release where *Prefix* = *Metal* and *Dictionary* = *Animal*.
2. Most importantly, pick an undeniably outstanding [name](http://www.codenamegenerator.com/) for the release where _Prefix_ = _Metal_ and _Dictionary_ = _Animal_.
3. Check whether the GitHub Actions workflow scripts need updating of the Nextflow versions
4. Create a PR to `dev` to bump the version in `CHANGELOG.md` and `setup.py`.
4. Create a PR to `dev` to bump the version in `CHANGELOG.md` and `setup.py`.
5. Make sure all CI tests are passing!
6. Create a PR from `dev` to `master`
7. Make sure all CI tests are passing again (additional tests are run on PRs to `master`)
Expand All @@ -18,4 +18,4 @@
1. Check the automated template synchronisation has been triggered properly. This should automatically open PRs directly to individual pipeline repos with the appropriate changes to update the pipeline template.
2. Check that the automatic `PyPi` deployment has worked: [pypi.org/project/nf-core](https://pypi.org/project/nf-core/)
3. Check `BioConda` has an automated PR to bump the version, and merge. eg. [bioconda/bioconda-recipes #20065](https://github.com/bioconda/bioconda-recipes/pull/20065)
4. Create a tools PR to `dev` to bump back to the next development version in `CHANGELOG.md` and `setup.py`
4. Create a tools PR to `dev` to bump back to the next development version in `CHANGELOG.md` and `setup.py`
41 changes: 33 additions & 8 deletions .github/workflows/create-lint-wf.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create a pipeline and lint it
name: Create a pipeline and run nf-core linting
on: [push, pull_request]

env:
Expand All @@ -15,15 +15,17 @@ jobs:
# Nextflow versions
include:
# Test pipeline minimum Nextflow version
- NXF_VER: '21.10.3'
NXF_EDGE: ''
- NXF_VER: "21.10.3"
NXF_EDGE: ""
# Test latest edge release of Nextflow
- NXF_VER: ''
NXF_EDGE: '1'
- NXF_VER: ""
NXF_EDGE: "1"
steps:
# Get the repo code
- uses: actions/checkout@v2
name: Check out source-code repository

# Set up nf-core/tools
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
Expand All @@ -34,6 +36,7 @@ jobs:
python -m pip install --upgrade pip
pip install .

# Set up Nextflow
- name: Install Nextflow
env:
NXF_VER: ${{ matrix.NXF_VER }}
Expand All @@ -44,21 +47,43 @@ jobs:
wget -qO- get.nextflow.io | bash
sudo mv nextflow /usr/local/bin/

# Install the Prettier linting stuff
- uses: actions/setup-node@v2

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

# Build a pipeline from the template
- name: nf-core create
run: nf-core --log-file log.txt create -n testpipeline -d "This pipeline is for testing" -a "Testing McTestface"

# Try syncing it before we change anything
- name: nf-core sync
run: nf-core --log-file log.txt sync --dir nf-core-testpipeline/

# Build a module from the template
- name: nf-core modules create
run: nf-core --log-file log.txt modules create bpipe --dir nf-core-testpipeline --author @nf-core-bot --label process_low --meta

# Run code style linting
- name: Run Prettier --check
run: prettier --check nf-core-testpipeline

# Update modules to the latest version
- name: nf-core modules update
run: nf-core --log-file log.txt modules update --dir nf-core-testpipeline --all --no-preview

# Run nf-core linting
- name: nf-core lint
run: nf-core --log-file log.txt lint --dir nf-core-testpipeline --fail-ignored

# Run the other nf-core commands
- name: nf-core list
run: nf-core --log-file log.txt list

# - name: nf-core licences
# run: nf-core --log-file log.txt licences nf-core-testpipeline

- name: nf-core sync
run: nf-core --log-file log.txt sync --dir nf-core-testpipeline/

- name: nf-core schema
run: nf-core --log-file log.txt schema build --dir nf-core-testpipeline/ --no-prompts

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/create-test-wf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
# Nextflow versions
include:
# Test pipeline minimum Nextflow version
- NXF_VER: '21.10.3'
NXF_EDGE: ''
- NXF_VER: "21.10.3"
NXF_EDGE: ""
# Test latest edge release of Nextflow
- NXF_VER: ''
NXF_EDGE: '1'
- NXF_VER: ""
NXF_EDGE: "1"
steps:
- uses: actions/checkout@v2
name: Check out source-code repository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
name: Lint Python
on:
push:
paths:
- '**.py'
pull_request:
paths:
- '**.py'
name: Lint tools code formatting
on: [push, pull_request]

jobs:
PythonLint:
Prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-node@v2

- 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@v2
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/markdown-lint.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tools-api-docs-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
server: ${{ secrets.ftp_server }}
username: ${{ secrets.ftp_username}}
password: ${{ secrets.ftp_password }}
local-dir: './docs/api/_build/html/'
local-dir: "./docs/api/_build/html/"
server-dir: ${{ secrets.ftp_server_dir }}/dev/
protocol: ${{ secrets.ftp_protocol }}
port: ${{ secrets.ftp_port }}
2 changes: 1 addition & 1 deletion .github/workflows/tools-api-docs-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
server: ${{ secrets.ftp_server }}
username: ${{ secrets.ftp_username}}
password: ${{ secrets.ftp_password }}
local-dir: './docs/api/_build/html/'
local-dir: "./docs/api/_build/html/"
server-dir: ${{ secrets.ftp_server_dir }}/${{ matrix.dir }}/
protocol: ${{ secrets.ftp_protocol }}
port: ${{ secrets.ftp_port }}
39 changes: 0 additions & 39 deletions .github/workflows/yamllint.yml

This file was deleted.

19 changes: 9 additions & 10 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@ tasks:
- name: install current state of nf-core/tools
command: python -m pip install --upgrade -r requirements-dev.txt -e .
vscode:
extensions: # based on nf-core.nf-core-extensionpack
- codezombiech.gitignore # Language support for .gitignore files
extensions: # based on nf-core.nf-core-extensionpack
- codezombiech.gitignore # Language support for .gitignore files
# - cssho.vscode-svgviewer # SVG viewer
- davidanson.vscode-markdownlint # Markdown/CommonMark linting and style checking for Visual Studio Code
- eamodio.gitlens # Quickly glimpse into whom, why, and when a line or code block was changed
- EditorConfig.EditorConfig # override user/workspace settings with settings found in .editorconfig files
- Gruntfuggly.todo-tree # Display TODO and FIXME in a tree view in the activity bar
- mechatroner.rainbow-csv # Highlight columns in csv files in different colors
- esbenp.prettier-vscode # Markdown/CommonMark linting and style checking for Visual Studio Code
- eamodio.gitlens # Quickly glimpse into whom, why, and when a line or code block was changed
- EditorConfig.EditorConfig # override user/workspace settings with settings found in .editorconfig files
- Gruntfuggly.todo-tree # Display TODO and FIXME in a tree view in the activity bar
- mechatroner.rainbow-csv # Highlight columns in csv files in different colors
# - nextflow.nextflow # Nextflow syntax highlighting
- oderwat.indent-rainbow # Highlight indentation level
- streetsidesoftware.code-spell-checker # Spelling checker for source code
- DavidAnson.vscode-markdownlint # Linter for markdown files
- oderwat.indent-rainbow # Highlight indentation level
- streetsidesoftware.code-spell-checker # Spelling checker for source code
18 changes: 0 additions & 18 deletions .markdownlint.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docs/api/_build
testing

1 change: 1 addition & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
printWidth: 120
7 changes: 0 additions & 7 deletions .yamllint.yml

This file was deleted.

Loading