Skip to content

Commit

Permalink
Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
ecino committed Nov 23, 2023
1 parent 6010264 commit 229207a
Show file tree
Hide file tree
Showing 19 changed files with 165 additions and 564 deletions.
187 changes: 0 additions & 187 deletions .eslintrc.yml

This file was deleted.

13 changes: 0 additions & 13 deletions .flake8

This file was deleted.

8 changes: 5 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.12"
- uses: pre-commit/[email protected]
13 changes: 0 additions & 13 deletions .isort.cfg

This file was deleted.

39 changes: 6 additions & 33 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
exclude: |
(?x)
# NOT INSTALLABLE ADDONS
# END NOT INSTALLABLE ADDONS
# Files and folders generated by bots, to avoid loops
^setup/|/static/description/index\.html$|
# We don't want to mess with tool-generated files
.svg$|/tests/([^/]+/)?cassettes/|^.copier-answers.yml$|^.github/|
# Maybe reactivate this when all README files include prettier ignore tags?
^README\.md$|
# Library files can have extraneous formatting (even minimized)
/static/(src/)?lib/|
# Repos using Sphinx to generate docs don't need prettying
^docs/_templates/.*\.html$|
# You don't usually want a bot to modify your legal texts
(LICENSE.*|COPYING.*)
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.4.1
hooks:
- id: prettier
# https://github.com/prettier/prettier/issues/12143
exclude: "}$"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-docstring-first
Expand All @@ -41,16 +21,9 @@ repos:
- id: mixed-line-ending
args: ["--fix=lf"]
- id: trailing-whitespace
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
additional_dependencies: ["flake8-bugbear==21.9.2"]
- repo: https://github.com/asottile/pyupgrade
rev: v2.29.0
hooks:
- id: pyupgrade
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
hooks:
- id: isort
- id: ruff
args: [--exit-non-zero-on-fix]
- id: ruff-format
41 changes: 41 additions & 0 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
- id: oca-gen-addon-readme
name: Generate addons README files from fragments
always_run: true
entry: oca-gen-addon-readme
language: python
pass_filenames: false

- id: oca-gen-addons-table
name: Generate addons table in README
always_run: true
entry: oca-gen-addons-table
language: python
pass_filenames: false

- id: oca-gen-addon-icon
name: Generate addons icons
always_run: true
entry: oca-gen-addon-icon
language: python
pass_filenames: false

- id: oca-update-pre-commit-excluded-addons
name: Update pre-commit excluded addons
entry: oca-update-pre-commit-excluded-addons
pass_filenames: false
language: python
always_run: true

- id: oca-fix-manifest-website
name: Fix the manifest website key
entry: oca-fix-manifest-website
pass_filenames: false
language: python
files: (__manifest__\.py|__openerp__\.py|__terp__\.py)$

- id: oca-gen-external-dependencies
name: Generate requirements.txt for an addons directory
entry: oca-gen-external-dependencies
language: python
pass_filenames: false
files: (__manifest__\.py|__openerp__\.py|__terp__\.py|setup\.py|pyproject\.toml)$
Loading

0 comments on commit 229207a

Please sign in to comment.