From e648b207871549df287612965d4fa12fd766cbbd Mon Sep 17 00:00:00 2001 From: Phil Ewels Date: Mon, 26 May 2025 09:49:09 +0200 Subject: [PATCH] Add prettier, editorconfig and pre-commit --- .editorconfig | 12 ++++++++ .github/ISSUE_TEMPLATE/new_pipeline.yml | 19 ++++++------ .github/ISSUE_TEMPLATE/new_rfc.yml | 19 ++++++------ .../new_special_interest_group.yml | 10 +++---- .github/workflows/pre-commit.yml | 29 +++++++++++++++++++ .pre-commit-config.yaml | 13 +++++++++ .prettierrc.yml | 1 + README.md | 12 ++++---- 8 files changed, 84 insertions(+), 31 deletions(-) create mode 100644 .editorconfig create mode 100644 .github/workflows/pre-commit.yml create mode 100644 .pre-commit-config.yaml create mode 100644 .prettierrc.yml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..014c238 --- /dev/null +++ b/.editorconfig @@ -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,cff}] +indent_size = 2 diff --git a/.github/ISSUE_TEMPLATE/new_pipeline.yml b/.github/ISSUE_TEMPLATE/new_pipeline.yml index 8b081e7..0231313 100644 --- a/.github/ISSUE_TEMPLATE/new_pipeline.yml +++ b/.github/ISSUE_TEMPLATE/new_pipeline.yml @@ -4,14 +4,13 @@ title: "New pipeline: nf-core/" labels: "new-pipeline,proposed" projects: nf-core/104 body: - - type: input attributes: label: Pipeline title/name description: Names should be [lower case, without punctuation, and descriptive](https://nf-co.re/docs/guidelines/pipelines/requirements/workflow_name) (not 'fun' names). placeholder: rnaseq validations: - required: true + required: true - type: input attributes: @@ -19,23 +18,23 @@ body: description: Provide a comma separated list of useful keywords for data type/analysis type/research field of the proposal (e.g. genomics, cancer, variant calling). placeholder: genomics, cancer, variant calling validations: - required: true + required: true - type: textarea attributes: label: What is it about? description: Give a short summary of the purpose of the pipeline. - placeholder: An RNA sequencing analysis pipeline using STAR, RSEM, HISAT2 or Salmon with gene/isoform counts and extensive quality control. + placeholder: An RNA sequencing analysis pipeline using STAR, RSEM, HISAT2 or Salmon with gene/isoform counts and extensive quality control. validations: - required: true + required: true - type: textarea attributes: label: Please provide a schematic diagram of the proposed pipeline description: Please use tool names as each 'node'. Drag and drop the image file into the text area to upload. - placeholder: ![](https://your.url/image/png) + placeholder: "![](https://your.url/image/png)" validations: - required: true + required: true - type: checkboxes attributes: @@ -66,7 +65,7 @@ body: label: Why do we need a new pipeline? description: Describe the 'usefuless' or 'novelty' of the pipeline whether analytically or within nf-core. validations: - required: true + required: true - type: textarea attributes: @@ -74,7 +73,7 @@ body: description: Please give possible target audiences of the pipelines. placeholder: Researchers working on transcriptomics. validations: - required: true + required: true - type: textarea attributes: @@ -82,7 +81,7 @@ body: description: Please describe the current status of the concept or code, or say if you have not stated. placeholder: I have started making nf-core modules for tools I would use in the proposed pipeline. validations: - required: true + required: true - type: input attributes: diff --git a/.github/ISSUE_TEMPLATE/new_rfc.yml b/.github/ISSUE_TEMPLATE/new_rfc.yml index b7d05de..2193173 100644 --- a/.github/ISSUE_TEMPLATE/new_rfc.yml +++ b/.github/ISSUE_TEMPLATE/new_rfc.yml @@ -11,40 +11,39 @@ body: label: Summary description: Short 2-3 sentence summary of RFC proposal. validations: - required: true + required: true - type: input attributes: label: Champion description: "GitHub handle of the proposal's champion (if already found)." - placeholder: - e.g. @maxulysse + placeholder: e.g. @maxulysse - type: textarea attributes: label: Background & Motivation description: Provide the context of the proposal, summarising the existing status-quo or issues. - placeholder: + placeholder: validations: - required: true + required: true - type: textarea attributes: label: Goals - description: Provide a 2-3 bullet point list of the main aims and objectives the outcome RFC aims to achieve + description: Provide a 2-3 bullet point list of the main aims and objectives the outcome RFC aims to achieve placeholder: | - Goal 1 - Goal 2 - Goal 3 validations: - required: true + required: true - type: textarea attributes: label: "Non-Goals" - description: Provide a 2-3 bullet point list of the main aims and objectives the outcome RFC aims NOT to achieve. + description: Provide a 2-3 bullet point list of the main aims and objectives the outcome RFC aims NOT to achieve. placeholder: | - Non-goal 1 - Non-goal 2 - Non-goal 3 validations: - required: false + required: false - type: textarea attributes: label: References @@ -54,4 +53,4 @@ body: - Original GitHub Issue - https://github.com/nf-core/ - Prototype - https://github.com/nf-core/ validations: - required: false + required: false diff --git a/.github/ISSUE_TEMPLATE/new_special_interest_group.yml b/.github/ISSUE_TEMPLATE/new_special_interest_group.yml index 835957d..d97d2cf 100644 --- a/.github/ISSUE_TEMPLATE/new_special_interest_group.yml +++ b/.github/ISSUE_TEMPLATE/new_special_interest_group.yml @@ -18,14 +18,14 @@ body: description: Suggested interest group name. It should be as simple, descriptive and boring as possible. placeholder: Animal Genomics validations: - required: true + required: true - type: textarea attributes: label: What is it about? description: Give a one sentence description of the purpose of the special interest group. validations: - required: true + required: true - type: input attributes: @@ -33,21 +33,21 @@ body: description: Provide a comma separated list of useful keywords for topics related to the proposal (e.g. genomics, cancer, variant calling). placeholder: genomics, cancer, variant calling validations: - required: true + required: true - type: textarea attributes: label: Why do we need a new special interest group? description: Describe the 'usefuless' or 'novelty' of the special interest group within nf-core. validations: - required: true + required: true - type: textarea attributes: label: Who would be interested? description: Please give possible target audiences of the special interest groups. validations: - required: true + required: true - type: textarea attributes: diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..b59a744 --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,29 @@ +name: Lint tools code formatting +on: + push: + pull_request: + +# Cancel if a newer run is started +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + Pre-commit: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Set up Python 3.12 + uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 + with: + python-version: "3.12" + cache: "pip" + + - name: Install pre-commit + run: pip install pre-commit + + - name: Run pre-commit + run: pre-commit run --all-files diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..326d4d8 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,13 @@ +repos: + - repo: https://github.com/pre-commit/mirrors-prettier + rev: "v3.1.0" + hooks: + - id: prettier + additional_dependencies: + - prettier@3.3.3 + + - repo: https://github.com/editorconfig-checker/editorconfig-checker.python + rev: "3.1.2" + hooks: + - id: editorconfig-checker + alias: ec diff --git a/.prettierrc.yml b/.prettierrc.yml new file mode 100644 index 0000000..c81f9a7 --- /dev/null +++ b/.prettierrc.yml @@ -0,0 +1 @@ +printWidth: 120 diff --git a/README.md b/README.md index 1f4cedb..291d321 100644 --- a/README.md +++ b/README.md @@ -23,13 +23,13 @@ To make a new proposal for a special interest group, please create a new issue i The curator workflow is as follows: -- [ ] Once a issue is made, update the 'Project' status to 'proposed' (right hand side bar, under 'new--proposals') +- [ ] Once a issue is made, update the 'Project' status to 'proposed' (right hand side bar, under 'new--proposals') - [ ] Facilitate discussion on the the Issue thread, following the guidance [here](https://nf-co.re/docs/checklists/community_governance/core_team#new-pipeline-proposals-and-onboarding). - [ ] Acceptance requires a minimum of OKs from: - - Two members of the core team. - - One member of the core team and one member of the maintainers team. + - Two members of the core team. + - One member of the core team and one member of the maintainers team. - [ ] If a proposal is accepted, update both the label AND status to 'accepted', and when closing select 'Close as completed' -- [ ] If a proposal is turned down, update both the label AND status to 'turned-down', and when closing select 'Close as not planned' +- [ ] If a proposal is turned down, update both the label AND status to 'turned-down', and when closing select 'Close as not planned' - [ ] If a proposal is not completed or abandoned after a year, update both the label AND status to 'timed-out', and when closing select 'Close as not planned' - [ ] Complete the reemaining new-pipeline onboarding tasks listed [here](https://nf-co.re/docs/checklists/community_governance/core_team#new-pipeline-proposals-and-onboarding) @@ -40,7 +40,7 @@ The curator workflow is as follows: - [ ] Once a issue is made, update the 'Project' status to 'proposed' (right hand side bar, under 'new--proposals') - [ ] Facilitate discussion on the the Issue thread, following the guidance [here](https://nf-co.re/blog/2024/special_interest_groups). - [ ] Acceptance requires a minimum of OKs from: - - Two members of the core team. + - Two members of the core team. - [ ] If a proposal is accepted, update both the label AND status to 'accepted', and when closing select 'Close as completed' -- [ ] If a proposal is turned down, update both the label AND status to 'turned-down', and when closing select 'Close as not planned' +- [ ] If a proposal is turned down, update both the label AND status to 'turned-down', and when closing select 'Close as not planned' - [ ] If a proposal is not completed or abandoned after a year, update both the label AND status to 'timed-out', and when closing select 'Close as not planned'