diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..ff8fb7fa --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,4 @@ +# Default owners of the repository +* @metoffice/ssdteam + +# Add component owners as appropriate diff --git a/.github/linters/.perlcriticrc b/.github/linters/.perlcriticrc new file mode 100644 index 00000000..56c7874d --- /dev/null +++ b/.github/linters/.perlcriticrc @@ -0,0 +1,5 @@ +# Report slightly less severe violations (severity >= 4) +severity = 4 +# Verbosity format +# filename:line:column [severity policy] message near 'string of source code that caused the violation' +verbose = %f:%l:%c [%s %p] %m near '%r'\n diff --git a/.github/linters/.python-black b/.github/linters/.python-black new file mode 100644 index 00000000..e69de29b diff --git a/.github/linters/.python-lint b/.github/linters/.python-lint new file mode 100644 index 00000000..b49d38ea --- /dev/null +++ b/.github/linters/.python-lint @@ -0,0 +1,20 @@ +[MASTER] +# Use multiple processes to speed up Pylint. +jobs=2 + +[MESSAGES CONTROL] +# C0114: Missing module docstring (missing-module-docstring) +# C0116: Missing function or method docstring (missing-function-docstring) +# C0103: Constant name doesn't conform to UPPER_CASE naming style (invalid-name) +# C0209: Formatting a regular string which could be an f-string (consider-using-f-string) +# E0401: Unable to import module (import-error) +# W0611: Unused import sphinx_rtd_theme (unused-import) +# W0622: Redefining built-in 'copyright' (redefined-builtin) +# R0801: Similar lines in 2 files +disable=C0114,C0116,C0103,C0209,E0401,W0611,W0622,R0801, + +[SIMILARITIES] +# Minimum lines number of a similarity. +min-similarity-lines=4 +ignore-comments=yes +ignore-docstrings=yes diff --git a/.github/linters/.ruff.toml b/.github/linters/.ruff.toml new file mode 100644 index 00000000..6fd57be6 --- /dev/null +++ b/.github/linters/.ruff.toml @@ -0,0 +1,13 @@ +cache-dir = "/tmp/.ruff_cache" +line-length = 80 + + +# Allow unused variables when underscore-prefixed. +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[format] +# Like Black, indent with spaces, rather than tabs. +indent-style = "space" + +# Like Black, respect magic trailing commas. +skip-magic-trailing-comma = false diff --git a/.github/linters/.shellcheckrc b/.github/linters/.shellcheckrc new file mode 100644 index 00000000..472bfba3 --- /dev/null +++ b/.github/linters/.shellcheckrc @@ -0,0 +1 @@ +source-path=SCRIPTDIR diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..15fbc1cc --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,32 @@ +# Description + +## Summary + +_Briefly describe the feature being introduced._ + +## Changes + +_List the major changes made in this pull request._ + +## Dependency + +_List dependent changes. Can use build-group logic here._ + +## Impact + +_Discuss any potential impacts this feature may have on existing functionalities._ + +## Issues addressed + +Resolves + +_List issue(s) related to this PR._ + +## Coordinated merge + +_Specify any coordinated merges here._ + + +## Checklist + +- [ ] I have performed a self-review of my own changes diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..a1dd74a7 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,59 @@ +--- +# Lint/analyse code with Super-Linter. +name: Checks + +on: + pull_request: + branches: [main] + push: + branches: [main, 'releases/**'] + workflow_dispatch: + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +permissions: read-all + +jobs: + check: + name: Lint + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12"] + + permissions: + contents: read + packages: read + statuses: write + + steps: + - name: Checkout current + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Super-Linter + uses: super-linter/super-linter/slim@85f7611e0f7b53c8573cca84aa0ed4344f6f6a4d # v7.2.1 + env: + FILTER_REGEX_EXCLUDE: (.*[.]conf.py|pull_request_template.md|/linters/) + IGNORE_GITIGNORED_FILES: true + VALIDATE_BASH_EXEC: false + VALIDATE_JAVASCRIPT_STANDARD: false + VALIDATE_JSCPD: false + VALIDATE_MARKDOWN_PRETTIER: false + VALIDATE_PYTHON_FLAKE8: false + VALIDATE_PYTHON_ISORT: false + VALIDATE_PYTHON_MYPY: false + VALIDATE_PYTHON_PYINK: false + VALIDATE_PYTHON_PYLINT: false + VALIDATE_PYTHON_RUFF: false + VALIDATE_SHELL_SHFMT: false + VALIDATE_YAML_PRETTIER: false + VALIDATE_YAML: false + # To report GitHub Actions status checks + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} +...