Skip to content

Commit

Permalink
changed workflow structure and modified ruff config
Browse files Browse the repository at this point in the history
  • Loading branch information
JHalbauer committed Dec 10, 2024
1 parent 6ced798 commit b4a8920
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 59 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
name: Python flake8, black, pylint and ruff code quality check and post PR code suggestions
name: Linting and code quality check

on: [push, pull_request]
on:
push:
pull_request:

jobs:
lint:
# LINE FOR TEST
# TODO: change branch of workflow repo (2x)
uses: mundialis/github-workflows/.github/workflows/linting.yml@test_post_pr_reviews
uses: mundialis/github-workflows/.github/workflows/linting.yml@main
with:
VALIDATE_HTML: false

post-pr-reviews:
needs: lint
# if: ${{ needs.lint.result == 'failure' }}
if: failure()
uses: mundialis/github-workflows/.github/workflows/post-pr-reviews.yml@test_post_pr_reviews
11 changes: 11 additions & 0 deletions .github/workflows/post-pr-reviews.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Post PR code suggestions

on:
workflow_run:
workflows: ["Linting and code quality check"]
types:
- completed

jobs:
post-pr-reviews:
uses: mundialis/github-workflows/.github/workflows/post-pr-reviews.yml@main
49 changes: 1 addition & 48 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# In addition to the standard set of exclusions, omit the following files or folders.
exclude = [
".git",
"__pycache__",
Expand All @@ -13,51 +12,6 @@ exclude = [
"pydispatch",
]

line-length = 79
target-version = "py38"

[lint]
# See https://docs.astral.sh/ruff/rules/
select = [
"AIR", # Airflow (AIR)
"YTT", # flake8-2020
"ANN", # flake8-annotations (ANN)
"ASYNC", # flake8-async
"S", # flake8-bandit
"FBT", # flake8-boolean-trap
"B", # flake8-bugbear
"A", # flake8-builtins (A)
"COM", # flake8-commas
"C4", # flake8-comprehension
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
"DJ", # flake8-django
"EM", # flake8-errmsg
"EXE", # flake8-executable
"FA", # flake8-future-annotations
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"LOG", # flake8-logging
"G", # flake8-logging-format
"INP", # flake8-no-pep420
"PIE", # flake8-pie
"PYI", # flake8-pyi
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"SLF", # flake8-self
"SLOT", # flake8-slots
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
"TCH", # flake8-type-checking
"ARG", # flake8-unused-arguments
"TD", # flake8-todos
"FIX", # flake8-fixme
"ERA", # eradicate
"PL", # Pylint
]

ignore = [
"E402", # module-import-not-at-top-of-file
"E501", # line-too-long
Expand All @@ -79,11 +33,10 @@ ignore = [
"PLR0912", # too-many-branches
"PLR0914", # too-many-local-variables
"PLR0917", # too-many-positional-arguments
# "PLR1730", # if-stmt-min-max
"PLR1730", # if-stmt-min-max
"PLR6201", # literal-membership
]

[lint.per-file-ignores]
# See https://docs.astral.sh/ruff/settings/#lint_per-file-ignores
"lib_dop/r_dop_import_lib.py" = ["ERA001", "PLR2004"]
"testsuite/r_dop_import_test_base.py" = ["PLR2004"]

0 comments on commit b4a8920

Please sign in to comment.