diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index db0b4ee9..5df97025 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,15 +1,10 @@ exclude: | (?x) ^template/ -default_language_version: - python: python3 repos: - - repo: https://github.com/PyCQA/flake8 - rev: 3.9.2 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.7.0 hooks: - - id: flake8 - name: flake8 - - repo: https://github.com/psf/black - rev: 22.8.0 - hooks: - - id: black + - id: ruff + args: [--fix] + - id: ruff-format diff --git a/tools/copier_update.py b/tools/copier_update.py index 2c8b62af..6ca98e6e 100644 --- a/tools/copier_update.py +++ b/tools/copier_update.py @@ -1,5 +1,5 @@ -"""Run copier update on a branch in all addons repos. -""" +"""Run copier update on a branch in all addons repos.""" + import subprocess import textwrap from pathlib import Path diff --git a/tools/create_branch.py b/tools/create_branch.py index 76b52390..bf501af0 100644 --- a/tools/create_branch.py +++ b/tools/create_branch.py @@ -3,6 +3,7 @@ TODO - load copier answers from a previous branch """ + import subprocess import click diff --git a/tools/fix_manifest_website.py b/tools/fix_manifest_website.py index 46c09a82..61616495 100644 --- a/tools/fix_manifest_website.py +++ b/tools/fix_manifest_website.py @@ -1,4 +1,5 @@ """Set the website key in addons manifests.""" + import os import re diff --git a/tools/oca_projects.py b/tools/oca_projects.py index 686ebd5d..7699c48a 100644 --- a/tools/oca_projects.py +++ b/tools/oca_projects.py @@ -6,6 +6,7 @@ OCA_REPOSITORY_NAMES: list of OCA repository names """ + from __future__ import print_function from contextlib import contextmanager import os diff --git a/tools/oca_sync_users.py b/tools/oca_sync_users.py index 2a759e52..a789ff50 100644 --- a/tools/oca_sync_users.py +++ b/tools/oca_sync_users.py @@ -6,6 +6,7 @@ This enables adding them to project teams in the OCA instance. """ + from __future__ import absolute_import, print_function import xmlrpclib diff --git a/tools/odoo_login.py b/tools/odoo_login.py index 00611560..5fe761cc 100644 --- a/tools/odoo_login.py +++ b/tools/odoo_login.py @@ -58,7 +58,7 @@ def get_parser(with_help=False): action="store_true", help="Store the username and password in a " "configuration file. Warning, clear text!", - ), + ) return parser diff --git a/tools/set_repo_labels.py b/tools/set_repo_labels.py index 537d2711..1e0abb81 100644 --- a/tools/set_repo_labels.py +++ b/tools/set_repo_labels.py @@ -4,6 +4,7 @@ Create and modify labels on github to have same labels and same color on all repo """ + from __future__ import print_function import click