Skip to content

Commit

Permalink
Merge pull request #2545 from mashehu/add-mypy-to-pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu authored Nov 28, 2023
2 parents c78017b + 1ad27a7 commit ead61f4
Show file tree
Hide file tree
Showing 25 changed files with 102 additions and 97 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/create-lint-wf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- "latest-everything"
steps:
# Get the repo code
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Check out source-code repository

# Set up nf-core/tools
Expand All @@ -48,7 +48,7 @@ jobs:
version: ${{ matrix.NXF_VER }}

# Install the Prettier linting tools
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4

- name: Install Prettier
run: npm install -g prettier
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create-test-lint-wf-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- "template_skip_nf_core_configs.yml"

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Check out source-code repository

- name: Set up Python 3.12
Expand All @@ -52,7 +52,7 @@ jobs:
version: latest-everything

# Install the Prettier linting tools
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4

- name: Install Prettier
run: npm install -g prettier
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-test-wf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- "23.04.0"
- "latest-everything"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Check out source-code repository

- name: Set up Python 3.12
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Check out source-code repository

- name: Set up Python 3.12
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fix-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Use the @nf-core-bot token to check out so we can push later
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.nf_core_bot_auth_token }}

Expand All @@ -24,7 +24,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.nf_core_bot_auth_token }}

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4

- name: Install Prettier
run: npm install -g prettier @prettier/plugin-php
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/lint-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
EditorConfig:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4

- name: Install editorconfig-checker
run: npm install -g editorconfig-checker
Expand All @@ -30,9 +30,9 @@ jobs:
Prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4

- name: Install Prettier
run: npm install -g prettier
Expand All @@ -43,7 +43,7 @@ jobs:
PythonBlack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Check code lints with Black
uses: psf/black@stable
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out source-code repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v4
Expand All @@ -89,8 +89,8 @@ jobs:
static-type-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.12
cache: "pip"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push_dockerhub_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fail-fast: false
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build nfcore/tools:dev docker image
run: docker build --no-cache . -t nfcore/tools:dev
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push_dockerhub_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fail-fast: false
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build nfcore/tools:latest docker image
run: docker build --no-cache . -t nfcore/tools:latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rich-codex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:
matrix: ${{fromJson(needs.get-pipelines.outputs.matrix)}}
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Check out nf-core/tools

- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: Check out nf-core/${{ matrix.pipeline }}
with:
repository: nf-core/${{ matrix.pipeline }}
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 @@ -24,7 +24,7 @@ jobs:

steps:
- name: Check out source-code repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v4
Expand Down
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 @@ -19,7 +19,7 @@ jobs:
- ${{ github.event.release.tag_name }}
steps:
- name: Check out source-code repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.12
uses: actions/setup-python@v4
Expand Down
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,13 @@ repos:
rev: "v2.7.1"
hooks:
- id: prettier
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.7.1" # Use the sha / tag you want to point at
hooks:
- id: mypy
additional_dependencies:
- types-PyYAML
- types-requests
- types-jsonschema
- types-Markdown
- types-setuptools
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
- Change testing framework for modules and subworkflows from pytest to nf-test ([#2490](https://github.com/nf-core/tools/pull/2490))
- `bump_version` keeps now the indentation level of the updated version entries ([#2514](https://github.com/nf-core/tools/pull/2514))
- Run tests with Python 3.12 ([#2522](https://github.com/nf-core/tools/pull/2522)).
- Add mypy to pre-commit config for the tools repo ([#2545](https://github.com/nf-core/tools/pull/2545))

# [v2.10 - Nickel Ostrich](https://github.com/nf-core/tools/releases/tag/2.10) + [2023-09-25]

Expand Down
5 changes: 3 additions & 2 deletions docs/api/_src/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#
import os
import sys
from typing import Dict

sys.path.insert(0, os.path.abspath("../../../nf_core"))
import nf_core
Expand Down Expand Up @@ -58,7 +59,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language: str = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down Expand Up @@ -113,7 +114,7 @@

# -- Options for LaTeX output ------------------------------------------------

latex_elements = {
latex_elements: Dict[str, str] = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
Expand Down
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[mypy]
warn_unused_configs = True
ignore_missing_imports = true
Loading

0 comments on commit ead61f4

Please sign in to comment.