Skip to content

💚 ci(pre-commit): replace prettier workflow with pre-commit #501

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

Merged
merged 1 commit into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/nextflow-io/training:latest

ENV NXF_VER=24.10.0
ENV NXF_EDGE=0
ENV NXF_EDGE=0
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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

# ignore python and markdown
[*.{py,md}]
indent_style = unset
64 changes: 32 additions & 32 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,40 @@
name: Build GitPod Docker image

on:
pull_request:
push:
branches: [master]
release:
types: [published]
pull_request:
push:
branches: [master]
release:
types: [published]

jobs:
push_to_registry:
if: github.repository == 'nextflow-io/training'
name: Build + Push Gitpod Docker image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
push_to_registry:
if: github.repository == 'nextflow-io/training'
name: Build + Push Gitpod Docker image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build / push latest image
uses: docker/build-push-action@v5
if: github.event_name != 'release'
with:
file: .github/gitpod.Dockerfile
push: ${{ github.event_name == 'push' }}
tags: ghcr.io/nextflow-io/training:latest
- name: Build / push latest image
uses: docker/build-push-action@v5
if: github.event_name != 'release'
with:
file: .github/gitpod.Dockerfile
push: ${{ github.event_name == 'push' }}
tags: ghcr.io/nextflow-io/training:latest

- name: Push release image
uses: docker/build-push-action@v5
if: github.event_name == 'release'
with:
file: .github/gitpod.Dockerfile
push: true
tags: ghcr.io/nextflow-io/training:${{ github.event.release.tag_name }}
- name: Push release image
uses: docker/build-push-action@v5
if: github.event_name == 'release'
with:
file: .github/gitpod.Dockerfile
push: true
tags: ghcr.io/nextflow-io/training:${{ github.event.release.tag_name }}
44 changes: 22 additions & 22 deletions .github/workflows/mkdocs-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
name: Build mkdocs docker image

on:
pull_request:
push:
branches: [master]
pull_request:
push:
branches: [master]

jobs:
mkdocs_docker:
if: github.repository == 'nextflow-io/training'
name: Build + push mkdocs docker image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
mkdocs_docker:
if: github.repository == 'nextflow-io/training'
name: Build + push mkdocs docker image
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build / push latest image
uses: docker/build-push-action@v5
with:
file: .github/mkdocs.Dockerfile
push: ${{ github.event_name == 'push' }}
tags: ghcr.io/nextflow-io/training-mkdocs:latest
- name: Build / push latest image
uses: docker/build-push-action@v5
with:
file: .github/mkdocs.Dockerfile
push: ${{ github.event_name == 'push' }}
tags: ghcr.io/nextflow-io/training-mkdocs:latest
15 changes: 15 additions & 0 deletions .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Pre-commit checks

on:
push:
pull_request:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: pre-commit/action@v3.0.1
18 changes: 0 additions & 18 deletions .github/workflows/prettier.yml

This file was deleted.

76 changes: 38 additions & 38 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,51 @@ workspaceLocation: gitpod/gitpod-ws.code-workspace
checkoutLocation: gitpod

github:
prebuilds:
# enable for the master/default branch (defaults to true)
master: true
# enable for all branches in this repo (defaults to false)
branches: false
# enable for pull requests coming from this repo (defaults to true)
pullRequests: true
# enable for pull requests coming from forks (defaults to false)
pullRequestsFromForks: true
# add a "Review in Gitpod" button as a comment to pull requests (defaults to true)
addComment: true
# add a "Review in Gitpod" button to pull requests (defaults to false)
addBadge: false
prebuilds:
# enable for the master/default branch (defaults to true)
master: true
# enable for all branches in this repo (defaults to false)
branches: false
# enable for pull requests coming from this repo (defaults to true)
pullRequests: true
# enable for pull requests coming from forks (defaults to false)
pullRequestsFromForks: true
# add a "Review in Gitpod" button as a comment to pull requests (defaults to true)
addComment: true
# add a "Review in Gitpod" button to pull requests (defaults to false)
addBadge: false

# See .github/Dockerfile
image: ghcr.io/nextflow-io/training:latest

tasks:
- before: printf 'unset JAVA_TOOL_OPTIONS\n' >> $HOME/.bashrc && exit
- before: printf 'unset JAVA_TOOL_OPTIONS\n' >> $HOME/.bashrc && exit

- name: Start web server
command: gp ports await 23000 && gp preview https://training.nextflow.io/hello_nextflow
- name: Start web server
command: gp ports await 23000 && gp preview https://training.nextflow.io/hello_nextflow

- name: Load Nextflow Tutorial
command: docker pull -q nextflow/rnaseq-nf
- name: Load Nextflow Tutorial
command: docker pull -q nextflow/rnaseq-nf

- name: Start Nextflow Tutorial
env:
NXF_HOME: "/workspace/gitpod/.nextflow"
command: |
cd hello-nextflow
source $HOME/.bashrc
export PS1='\[\e[3;36m\]${PWD/*\//} ->\[\e[0m\] '
unset JAVA_TOOL_OPTIONS
clear
- name: Start Nextflow Tutorial
env:
NXF_HOME: "/workspace/gitpod/.nextflow"
command: |
cd hello-nextflow
source $HOME/.bashrc
export PS1='\[\e[3;36m\]${PWD/*\//} ->\[\e[0m\] '
unset JAVA_TOOL_OPTIONS
clear

vscode:
extensions: # based on nf-core.nf-core-extensionpack
- codezombiech.gitignore # Language support for .gitignore files
- cssho.vscode-svgviewer # SVG viewer
- esbenp.prettier-vscode # Markdown/CommonMark linting and style checking for Visual Studio Code
- 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
- ms-vscode.live-server
extensions: # based on nf-core.nf-core-extensionpack
- codezombiech.gitignore # Language support for .gitignore files
- cssho.vscode-svgviewer # SVG viewer
- esbenp.prettier-vscode # Markdown/CommonMark linting and style checking for Visual Studio Code
- 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
- ms-vscode.live-server
40 changes: 20 additions & 20 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
repos:
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
hooks:
- id: prettier
additional_dependencies:
- prettier@3.2.5
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
hooks:
- id: prettier
additional_dependencies:
- prettier@3.2.5

- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: "2.7.3"
hooks:
- id: editorconfig-checker
alias: ec
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: "2.7.3"
hooks:
- id: editorconfig-checker
alias: ec

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude_types:
- svg
- id: end-of-file-fixer
exclude_types:
- svg
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude_types:
- svg
- id: end-of-file-fixer
exclude_types:
- svg
4 changes: 0 additions & 4 deletions .prettierrc

This file was deleted.

46 changes: 23 additions & 23 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

Table of contents:

- [Contributing](#contributing)
- [Contribution model](#contribution-model)
- [Installation](#installation)
- [Docker](#docker)
- [Python](#python)
- [Social cards](#social-cards)
- [Figures \& diagrams](#figures--diagrams)
- [Content style and formatting](#content-style-and-formatting)
- [Formatting / linting](#formatting--linting)
- [Admonitions](#admonitions)
- [Known limitations](#known-limitations)
- [Code annotations](#code-annotations)
- [Word highlighting](#word-highlighting)
- [TODO / FIXME](#todo--fixme)
- [Contributing](#contributing)
- [Contribution model](#contribution-model)
- [Installation](#installation)
- [Docker](#docker)
- [Python](#python)
- [Social cards](#social-cards)
- [Figures \& diagrams](#figures--diagrams)
- [Content style and formatting](#content-style-and-formatting)
- [Formatting / linting](#formatting--linting)
- [Admonitions](#admonitions)
- [Known limitations](#known-limitations)
- [Code annotations](#code-annotations)
- [Word highlighting](#word-highlighting)
- [TODO / FIXME](#todo--fixme)

## Contribution model

Expand Down Expand Up @@ -92,11 +92,11 @@ If there is an announcement banner, you can enable and customise it using the fo

```yaml
extra:
# Announcement banner for upcoming training
announcement:
active: false
date_text: March 5-6, 2024
register_url: https://nf-co.re/events/2024/training-foundational-march
# Announcement banner for upcoming training
announcement:
active: false
date_text: March 5-6, 2024
register_url: https://nf-co.re/events/2024/training-foundational-march
```

If you need more customisation, edit `docs/assets/overrides/main.html`
Expand Down Expand Up @@ -136,9 +136,9 @@ There is a GitHub action that checks pull-requests for valid formatting.
We use admonitions extensively to make certain pieces of content stand out.
Please see the [official docs](https://squidfunk.github.io/mkdocs-material/reference/admonitions/) for an explanation.

- Note that we have two custom admonitions: `exercise` and `result` (alias `solution`).
- `!!!` does a regular admonition, `???` makes it collapsed (click to expand).
- Intendation is important! Make sure you check the rendered site, as it's easy to make a mistake.
- Note that we have two custom admonitions: `exercise` and `result` (alias `solution`).
- `!!!` does a regular admonition, `???` makes it collapsed (click to expand).
- Intendation is important! Make sure you check the rendered site, as it's easy to make a mistake.

## Known limitations

Expand Down Expand Up @@ -168,4 +168,4 @@ I recommend the [Todo Tree VSCode extension](https://marketplace.visualstudio.co

A list of key ones also included here:

- Remove plugin install from Phil's GitHub fork in `requirements.txt` and `.github/mkdocs.Dockerfile` when [this PR](https://github.com/timvink/mkdocs-enumerate-headings-plugin/pull/33) is merged
- Remove plugin install from Phil's GitHub fork in `requirements.txt` and `.github/mkdocs.Dockerfile` when [this PR](https://github.com/timvink/mkdocs-enumerate-headings-plugin/pull/33) is merged
Loading
Loading