Skip to content
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
8 changes: 5 additions & 3 deletions .github/linters/.ruff.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
cache-dir = "/tmp/.ruff_cache"
line-length = 80

line-length = 88

[lint]
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# undefined-local-with-import-star-usage
ignore = ["F405"]

[format]
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"

quote-style = "double"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
15 changes: 15 additions & 0 deletions .github/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
extends: default
ignore: |
.venv/
.svn/
rules:
comments:
level: warning
require-starting-space: true
min-spaces-from-content: 1
document-start: disable
indentation:
spaces: 2
indent-sequences: true
line-length: disable
truthy: disable
45 changes: 24 additions & 21 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,49 +11,52 @@ on:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

permissions: read-all

jobs:
check:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
max-parallel: 4
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.12", "3.14"]

permissions:
contents: read
packages: read
statuses: write
contents: 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
- name: Super-Lint
uses: super-linter/super-linter/slim@d5b0a2ab116623730dd094f15ddc1b6b25bf7b99 # v8.3.2
env:
FILTER_REGEX_EXCLUDE: (.*[.]conf.py|pull_request_template.md|/linters/)
# Once the codebase is perfectly linted/formatted, switch to validating only changed files
# VALIDATE_ALL_CODEBASE: false # lint and format new or changed files only
FILTER_REGEX_EXCLUDE: (.*[.]conf.py|pull_request_template.md)
FIX_PYTHON_RUFF_FORMAT: true
FIX_PYTHON_RUFF: true
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
VALIDATE_BASH: true
VALIDATE_CHECKOV: true
VALIDATE_GITHUB_ACTIONS: true
VALIDATE_GIT_LEAKS: true
VALIDATE_GIT_MERGE_CONFLICT_MARKERS: true
VALIDATE_JSON: true
VALIDATE_MARKDOWN: true
VALIDATE_NATURAL_LANGUAGE: true
VALIDATE_PERL: true
VALIDATE_PYTHON_RUFF_FORMAT: true
VALIDATE_PYTHON_RUFF: true
VALIDATE_YAML: true
# To report GitHub Actions status checks
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
...
8 changes: 4 additions & 4 deletions kgo_updates/kgo_update/kgo_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,13 +611,13 @@ def _split_lines(self, text, width):
"q to print all\n\n"
)
with open(script_path, "r") as f:
l = 0
line_count = 0
print_all = False
for line in f:
print(line, end="")
l += 1
if l == 10 and not print_all:
l = 0
line_count += 1
if line_count == 10 and not print_all:
line_count = 0
key = input()
if key.lower() == "q":
print_all = True
Expand Down
12 changes: 6 additions & 6 deletions lfric_macros/tests/test_apply_macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest

from ..apply_macros import *
from ..apply_macros import * # noqa: F403

# A macro that we want to find for these tests
desired_macro = """class vn00_t001(MacroUpgrade):
Expand Down Expand Up @@ -171,11 +171,11 @@ def test_deduplicate_list():


def test_match_python_imports():
assert match_python_import("import z") == True
assert match_python_import("from x import y") == True
assert match_python_import("from a import b.c") == True
assert match_python_import("import m as n") == True
assert match_python_import("false") == False
assert match_python_import("import z")
assert match_python_import("from x import y")
assert match_python_import("from a import b.c")
assert match_python_import("import m as n")
assert not match_python_import("false")


# Remove appsdir
Expand Down
Loading