Skip to content

Commit

Permalink
Merge pull request #1470 from ewels/use-prettier
Browse files Browse the repository at this point in the history
Use prettier
  • Loading branch information
ewels authored Mar 18, 2022
2 parents 0a4cb77 + a6dbdb1 commit 3abb7ef
Show file tree
Hide file tree
Showing 58 changed files with 1,514 additions and 1,358 deletions.
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

0 comments on commit 3abb7ef

Please sign in to comment.