Skip to content

Commit

Permalink
Merge pull request #1 from bit-bots/update/pre_commit_config
Browse files Browse the repository at this point in the history
Update pre-commit config
  • Loading branch information
Flova authored Nov 23, 2023
2 parents c088be6 + efc7907 commit c225834
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- name: Install cppcheck
run: sudo apt install cppcheck -y
- uses: pre-commit/[email protected]
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.277
rev: v0.1.6
hooks:
- id: ruff
args:
- "--fix"
- "--exit-non-zero-on-fix"
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.11.0
hooks:
- id: black
- repo: https://github.com/pocc/pre-commit-hooks
Expand Down
4 changes: 2 additions & 2 deletions bitbots_template_cpp/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ def count_files():
num_py = 0
num_cpp = 0

for root, dirs, files in os.walk(os.path.join(package_dir, "src")):
for _root, _dirs, files in os.walk(os.path.join(package_dir, "src")):
for f in files:
if f.endswith(".py"):
num_py += 1
for root, dirs, files in os.walk(os.path.join(package_dir, "include")):
for _root, _dirs, files in os.walk(os.path.join(package_dir, "include")):
for f in files:
if f.endswith(".h") or f.endswith(".hpp"):
num_cpp += 1
Expand Down
4 changes: 2 additions & 2 deletions bitbots_template_py/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ def count_files():
num_py = 0
num_cpp = 0

for root, dirs, files in os.walk(os.path.join(package_dir, "src")):
for _root, _dirs, files in os.walk(os.path.join(package_dir, "src")):
for f in files:
if f.endswith(".py"):
num_py += 1
for root, dirs, files in os.walk(os.path.join(package_dir, "include")):
for _root, _dirs, files in os.walk(os.path.join(package_dir, "include")):
for f in files:
if f.endswith(".h") or f.endswith(".hpp"):
num_cpp += 1
Expand Down
10 changes: 9 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@ line-length = 120

[tool.ruff]
line-length = 120
select = ["F", "E", "W", "I", "N", "UP"]
# Never enforce `E501` (line length violations), as black takes care of this.
ignore = ["E501"]
# Additionally enable the following rules
# - pycodestyle warnings (`W`)
# - flake8-bugbear warnings (`B`)
# - isort import sorting (`I`)
# - pep8-naming convenrtions (`N`)
# - pyupgrade prefer newer language constructs (`UP`)
select = ["F", "E", "B", "W", "I", "N", "UP"]

0 comments on commit c225834

Please sign in to comment.