Skip to content

Commit

Permalink
Merge branch 'main' into linkchecks
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenworsley authored Apr 19, 2024
2 parents 699ef63 + 0870a9a commit abaae3f
Show file tree
Hide file tree
Showing 136 changed files with 5,898 additions and 4,572 deletions.
17 changes: 0 additions & 17 deletions .coveragerc

This file was deleted.

4 changes: 0 additions & 4 deletions .flake8

This file was deleted.

19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Reference:
# - https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/keeping-your-actions-up-to-date-with-dependabot
# - https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#groups

version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
groups:
dependencies:
patterns:
- "*"
labels:
- "New: Pull Request"
- "Bot"
23 changes: 23 additions & 0 deletions .github/workflows/ci-manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: ci-manifest

on:
pull_request:
branches:
- "*"

push:
branches-ignore:
- "auto-update-lockfiles"
- "pre-commit-ci-update-config"
- "dependabot/*"

workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
manifest:
name: "check-manifest"
uses: scitools/workflows/.github/workflows/[email protected]
2 changes: 1 addition & 1 deletion .github/workflows/refresh-lockfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ on:

jobs:
refresh_lockfiles:
uses: scitools/workflows/.github/workflows/refresh-lockfiles.yml@2023.03.0
uses: scitools/workflows/.github/workflows/refresh-lockfiles.yml@2024.04.2
secrets: inherit
23 changes: 8 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,14 @@ repos:
# Don't commit to main branch.
- id: no-commit-to-branch

# TODO: pending the addition of ruff, including config file(s) - iris-grib#384
#- repo: https://github.com/astral-sh/ruff-pre-commit
# rev: "v0.3.4"
# hooks:
# - id: ruff
# types: [file, python]
# args: [--fix, --show-fixes]
# - id: ruff-format
# types: [file, python]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.3.4"
hooks:
- id: ruff
types: [file, python]
args: [--fix, --show-fixes]
- id: ruff-format
types: [file, python]

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
Expand All @@ -46,12 +45,6 @@ repos:
types_or: [asciidoc, python, markdown, rst]
additional_dependencies: [tomli]

- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
hooks:
- id: flake8
types: [file, python]

- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
Expand Down
207 changes: 207 additions & 0 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,207 @@
extend = "pyproject.toml"

lint.ignore = [
# pydocstyle (D)
# https://docs.astral.sh/ruff/rules/#pydocstyle-d
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D105", # Missing docstring in magic method
"D200", # One-line docstring should fit on one line
"D202", # No blank lines allowed after function docstring
"D205", # 1 blank line required between summary line and description
"D212", # Multi-line docstring summary should start at the second line
"D300", # Use triple double quotes """
"D301", # Use r""" if any backslashes in a docstring
"D400", # First line should end with a period
"D401", # First line of docstring should be in imperative mood
"D406", # Section name should end with a newline
"D407", # Missing dashed underline after section

# isort (I)
# https://docs.astral.sh/ruff/rules/#isort-i
"I001", # Import block is un-sorted or un-formatted

# Numpy-specific rules (NPY)
# https://docs.astral.sh/ruff/rules/#numpy-specific-rules-npy
"NPY002",

# flake8-builtins (A)
# https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"A001",
"A002",

# flake8-annotations (ANN)
"ANN001",
"ANN002",
"ANN003",
"ANN101",
"ANN102",
"ANN201",
"ANN202",
"ANN204",
"ANN205",
"ANN206",

# flake8-unused-arguments (ARG)
# https://docs.astral.sh/ruff/rules/#flake8-unused-arguments-arg
"ARG001",
"ARG002",
"ARG005",

# flake8-bugbear (B)
# https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"B007",
"B018",
"B028",
"B904",

# flake8-blind-except (BLE)
# https://docs.astral.sh/ruff/rules/#flake8-blind-except-ble
"BLE001",

# flake8-comprehensions (C4)
# https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
"C408",
"C901",

# flake8-datetimez (DTZ)
# https://docs.astral.sh/ruff/rules/#flake8-datetimez-dtz
"DTZ001",
"DTZ006",

# flake8-errmsg (EM)
"EM101",
"EM102",
"EM103",

# eradicate (ERA)
# https://docs.astral.sh/ruff/rules/#eradicate-era
"ERA001",

# flake8-boolean-trap (FBT)
# https://docs.astral.sh/ruff/rules/#flake8-boolean-trap-fbt
"FBT001",
"FBT002",
"FBT003",

# flake8-fixme (FIX)
# https://docs.astral.sh/ruff/rules/#flake8-fixme-fix
"FIX002",
"FIX003",

# pep8-naming (N)
# https://docs.astral.sh/ruff/rules/#pep8-naming-n
"N801",
"N802",
"N803",
"N806",
"N999",

# Perflint (PERF)
# https://docs.astral.sh/ruff/rules/#perflint-perf
"PERF203",
"PERF401",

# Refactor (R)
# https://docs.astral.sh/ruff/rules/#refactor-r
"PLR0402",
"PLR0912",
"PLR0913",
"PLR0915",
"PLR1714",
"PLR1722",
"PLR2004",
"PLR5501",

# Warning (W)
# https://docs.astral.sh/ruff/rules/#warning-w
"PLW0602",
"PLW2901",

# flake8-pytest-style (PT)
"PT009",
"PT027",

# flake8-use-pathlib (PTH)
# https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
"PTH100",
"PTH107",
"PTH110",
"PTH111",
"PTH112",
"PTH113",
"PTH118",
"PTH120",
"PTH122",
"PTH123",

# flake8-pyi (PYI)
# https://docs.astral.sh/ruff/rules/#flake8-pyi-pyi
"PYI024",

# flake8-return (RET)
# https://docs.astral.sh/ruff/rules/#flake8-return-ret
"RET503",
"RET504",
"RET505",
"RET506",

# flake8-raise (RSE)
# https://docs.astral.sh/ruff/rules/#flake8-raise-rse
"RSE102",

# Ruff-specific rules (RUF)
# https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
"RUF005",
"RUF012",
"RUF015",

# flake8-bandit (S)
# https://docs.astral.sh/ruff/rules/#flake8-bandit-s
"S101",
"S110",
"S603",
"S607",

# flake8-simplify (SIM)
# https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"SIM102",
"SIM108",
"SIM115",
"SIM117",
"SIM118",

# flake8-self (SLF)
# https://docs.astral.sh/ruff/rules/#flake8-self-slf
"SLF001",

# flake8-print (T20)
# https://docs.astral.sh/ruff/rules/#flake8-print-t20
"T201",

# flake8-todos (TD)
# https://docs.astral.sh/ruff/rules/#flake8-todos-td
"TD001",
"TD002",
"TD003",
"TD004",
"TD005",
"TD006",

# tryceratops (TRY)
# https://docs.astral.sh/ruff/rules/#tryceratops-try
"TRY003",
"TRY004",
"TRY301",

# pyupgrade (UP)
# https://docs.astral.sh/ruff/rules/#pyupgrade-up
"UP008",
"UP009",
"UP018",
"UP027",
"UP031",
"UP032",
]
15 changes: 15 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
prune .github
prune .nox
prune docs
prune requirements
recursive-include requirements *.txt
recursive-include iris_grib *.cml *.grib2 *.json *.nc *.py

exclude .coveragerc
exclude .flake8
exclude .gitignore
exclude .pre-commit-config.yaml
exclude .readthedocs.yml
exclude .ruff.toml
include *.md
include *.py
Loading

0 comments on commit abaae3f

Please sign in to comment.