Skip to content

Commit

Permalink
Add autofix for ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
iranzo committed Dec 16, 2024
1 parent 81d9a0c commit 66e01d0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 32 deletions.
48 changes: 18 additions & 30 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: v3.30.0
rev: v4.1.0
- hooks:
- id: check-useless-excludes
repo: meta
Expand All @@ -21,7 +21,8 @@ repos:
rev: 24.10.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 Down Expand Up @@ -53,53 +54,40 @@ repos:
- 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
# Ruff version.
rev: v0.6.9
rev: v0.8.3
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
args:
- --fix
- id: ruff-format

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

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

# - 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 # or other specific tag
rev: 0.2.3
hooks:
- id: yamlfmt
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

args:
- --mapping
- '2'
- --sequence
- '4'
- --offset
- '2'
- --preserve-quotes
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.14.0
hooks:
Expand Down
3 changes: 2 additions & 1 deletion risuclient/plugins/core/system/reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
import os
import re
import sys
from datetime import datetime, timedelta
from datetime import datetime
from datetime import timedelta

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

# Getting environment
global root_path
Expand Down

0 comments on commit 66e01d0

Please sign in to comment.