From b88e74957626c878e96c31f1de27e7e8d1a04f51 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 1 Feb 2023 13:52:04 -0700 Subject: [PATCH] Update pre-commit hook pycqa/flake8 to v6 (#26) * Removed eradicate due to wemake-services/flake8-eradicate#269 * Added YAML linter --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: jheddings --- .github/workflows/static-checks.yaml | 4 ++- .github/workflows/unit-tests.yaml | 4 ++- .pre-commit-config.yaml | 14 +++++++--- .yamllint | 39 ++++++++++++++++++++++++++++ etc/wxdat-example.yaml | 7 ++--- 5 files changed, 60 insertions(+), 8 deletions(-) create mode 100644 .yamllint diff --git a/.github/workflows/static-checks.yaml b/.github/workflows/static-checks.yaml index 7a8c0a7..f4ac863 100644 --- a/.github/workflows/static-checks.yaml +++ b/.github/workflows/static-checks.yaml @@ -1,7 +1,9 @@ --- name: Static File Checks -on: +# https://github.com/adrienverge/yamllint/issues/158 +on: # yamllint disable-line rule:truthy + push: branches: [main] pull_request: diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index 6852d8f..b395c29 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -1,7 +1,9 @@ --- name: Unit Tests -on: +# https://github.com/adrienverge/yamllint/issues/158 +on: # yamllint disable-line rule:truthy + push: branches: [main] pull_request: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 398cd25..8e8e219 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,10 @@ +--- repos: - repo: https://github.com/pycqa/isort rev: "5.12.0" hooks: - id: isort - args: [ --profile, black ] + args: [--profile, black] - repo: https://github.com/psf/black rev: "22.12.0" @@ -11,7 +12,7 @@ repos: - id: black - repo: https://github.com/pycqa/flake8 - rev: "4.0.1" + rev: "6.0.0" hooks: - id: flake8 additional_dependencies: @@ -19,10 +20,17 @@ repos: - flake8-breakpoint - flake8-bugbear - flake8-comprehensions - - flake8-eradicate + # - flake8-eradicate (wemake-services/flake8-eradicate#269) - flake8-logging-format + - repo: https://github.com/adrienverge/yamllint.git + rev: "v1.29.0" + hooks: + - id: yamllint + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: + - id: check-case-conflict + - id: check-merge-conflict - id: trailing-whitespace diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..8088da5 --- /dev/null +++ b/.yamllint @@ -0,0 +1,39 @@ +--- +extends: default + +yaml-files: + - '*.yaml' + - '*.yml' + - '.yamllint' + +ignore: | + tests/cassettes/ + +rules: + braces: enable + brackets: enable + colons: enable + commas: enable + comments: + level: warning + comments-indentation: + level: warning + document-end: disable + document-start: + level: warning + empty-lines: enable + empty-values: disable + hyphens: enable + indentation: enable + key-duplicates: enable + key-ordering: disable + line-length: + max: 88 + level: warning + new-line-at-end-of-file: enable + new-lines: enable + octal-values: disable + quoted-strings: disable + trailing-spaces: enable + truthy: + level: warning diff --git a/etc/wxdat-example.yaml b/etc/wxdat-example.yaml index 3806636..413487a 100644 --- a/etc/wxdat-example.yaml +++ b/etc/wxdat-example.yaml @@ -1,4 +1,5 @@ ## sample config file for wxdat app +--- # update interval (in seconds) for station data (may be specified per station); update_interval: 900 @@ -9,7 +10,7 @@ units: imperial # override the database connection string (used by SQLAlcheny) # database: sqlite:///wxdat.db -#------------------------------------------------------------------------------- +# ------------------------------------------------------------------------------ stations: - name: Denver Airport via WUnderground @@ -35,7 +36,7 @@ stations: provider: NOAA station: KDEN -#------------------------------------------------------------------------------- +# ------------------------------------------------------------------------------ # setup logging system -- or remove this section to disable logging # this uses the standard dict config for the Python logging framework logging: @@ -60,7 +61,7 @@ logging: formatter: brief stream: ext://sys.stdout logfile: - class : logging.FileHandler + class: logging.FileHandler formatter: precise filename: wxdat.log mode: w