diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ee27405..a6e63cb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -8,7 +8,7 @@ repos: - id: check-yaml - id: debug-statements - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.7.0 + rev: v0.9.10 hooks: - id: ruff args: [--exit-non-zero-on-fix] diff --git a/click_odoo_contrib/backupdb.py b/click_odoo_contrib/backupdb.py index 1029e10..02b489e 100644 --- a/click_odoo_contrib/backupdb.py +++ b/click_odoo_contrib/backupdb.py @@ -115,9 +115,11 @@ def main(env, dbname, dest, force, if_exists, format, filestore): filestore = False db = odoo.sql_db.db_connect(dbname) try: - with backup( - format, dest, "w" - ) as _backup, db.cursor() as cr, db_management_enabled(): + with ( + backup(format, dest, "w") as _backup, + db.cursor() as cr, + db_management_enabled(), + ): if format != "dump": _create_manifest(cr, dbname, _backup) if filestore: diff --git a/click_odoo_contrib/initdb.py b/click_odoo_contrib/initdb.py index f9d1d67..61a9f82 100644 --- a/click_odoo_contrib/initdb.py +++ b/click_odoo_contrib/initdb.py @@ -381,7 +381,7 @@ def main( odoo_createdb(new_database, demo, module_names, False) else: _logger.info( - "Cache disabled and no new database name provided. " "Nothing to do." + "Cache disabled and no new database name provided. Nothing to do." ) else: with pg_connect() as pgcr: diff --git a/click_odoo_contrib/update.py b/click_odoo_contrib/update.py index aefb708..a20e165 100644 --- a/click_odoo_contrib/update.py +++ b/click_odoo_contrib/update.py @@ -186,8 +186,7 @@ def _get_modules_to_update(cr, ignore_addons=None): modules_to_update = [] checksums = _load_installed_checksums(cr) cr.execute( - "SELECT name FROM ir_module_module " - "WHERE state in ('installed', 'to upgrade')" + "SELECT name FROM ir_module_module WHERE state in ('installed', 'to upgrade')" ) for (module_name,) in cr.fetchall(): if not _is_installable(module_name): diff --git a/tests/test_initdb.py b/tests/test_initdb.py index 5206c1d..5301c1e 100644 --- a/tests/test_initdb.py +++ b/tests/test_initdb.py @@ -273,9 +273,9 @@ def test_create_cmd_cache(dbcache, tmpdir): try: subprocess.check_call(cmd) with click_odoo.OdooEnvironment(database=TEST_DBNAME_NEW) as env: - assert env["ir.module.module"].search( - [("name", "=", "addon1")] - ), "module addon1 not present in new database" + assert env["ir.module.module"].search([("name", "=", "addon1")]), ( + "module addon1 not present in new database" + ) finally: _dropdb(TEST_DBNAME_NEW)