Skip to content

Commit

Permalink
Use ruff for flake8 replacement
Browse files Browse the repository at this point in the history
  • Loading branch information
iranzo committed Dec 16, 2024
1 parent 66e01d0 commit 0e9df2d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 31 deletions.
58 changes: 31 additions & 27 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
stages:
- commit-msg
repo: https://github.com/commitizen-tools/commitizen
rev: v4.1.0
rev: v3.29.0
- hooks:
- id: check-useless-excludes
repo: meta
Expand All @@ -18,11 +18,10 @@ repos:
- hooks:
- id: black
repo: https://github.com/python/black
rev: 24.10.0
rev: 24.8.0
- hooks:
- id: check-added-large-files
args:
- --maxkb=10000
args: [--maxkb=10000]
- id: check-ast
- id: check-case-conflict
- id: check-executables-have-shebangs
Expand All @@ -49,46 +48,51 @@ repos:
- id: check-byte-order-marker
- id: check-docstring-first
repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
- hooks:
- id: flake8
repo: https://github.com/pycqa/flake8
rev: 7.1.1
rev: v4.6.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.3
# Ruff version.
rev: v0.6.9
hooks:
# Run the linter.
- id: ruff
args:
- --fix
# Run the formatter.
- id: ruff-format

- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.10.0-2
rev: v3.9.0-1
hooks:
- id: shfmt
# Choose one of:
- id: shfmt # native (requires/installs Go to build)
args:
- -w
- -i
- '4'
- "4"
- -s
types:
- shell

- hooks:
- id: blacken-docs
repo: https://github.com/asottile/blacken-docs
rev: 1.19.1
rev: 1.18.0

# - repo: https://github.com/asottile/pyupgrade
# rev: v2.38.0
# hooks:
# - id: pyupgrade
# args: [--py39-plus]

- repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt
rev: 0.2.3
rev: 0.2.3 # or other specific tag
hooks:
- id: yamlfmt
args:
- --mapping
- '2'
- --sequence
- '4'
- --offset
- '2'
- --preserve-quotes
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.14.0
hooks:
- id: reorder-python-imports
args: [--mapping, "2", --sequence, "4", --offset, "2", "--preserve-quotes"]

# - repo: https://github.com/hcodes/yaspeller.git
# rev: v10.0.1
# hooks:
# - id: yaspeller
# types:
# - markdown
3 changes: 1 addition & 2 deletions risuclient/plugins/core/system/reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
import os
import re
import sys
from datetime import datetime
from datetime import timedelta
from datetime import datetime, timedelta

# Getting environment
global root_path
Expand Down
3 changes: 1 addition & 2 deletions risuclient/plugins/metadata/events/reboots.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
import os
import re
import sys
from datetime import datetime
from datetime import timedelta
from datetime import datetime, timedelta

# Getting environment
global root_path
Expand Down

0 comments on commit 0e9df2d

Please sign in to comment.