Skip to content

Commit

Permalink
Update pre-commit hook pycqa/flake8 to v6 (#26)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
renovate[bot] authored Feb 1, 2023
1 parent a100cbb commit b88e749
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/static-checks.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
14 changes: 11 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
---
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"
hooks:
- id: black

- repo: https://github.com/pycqa/flake8
rev: "4.0.1"
rev: "6.0.0"
hooks:
- id: flake8
additional_dependencies:
- flake8-alfred
- 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
39 changes: 39 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -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
7 changes: 4 additions & 3 deletions etc/wxdat-example.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,7 +10,7 @@ units: imperial
# override the database connection string (used by SQLAlcheny)
# database: sqlite:///wxdat.db

#-------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
stations:

- name: Denver Airport via WUnderground
Expand All @@ -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:
Expand All @@ -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

0 comments on commit b88e749

Please sign in to comment.