From e4de633b530ead5079a0db7cc4dd3321bf735da3 Mon Sep 17 00:00:00 2001 From: "Moises Lopez - https://www.vauxoo.com/" Date: Mon, 19 Jan 2026 10:05:20 -0600 Subject: [PATCH] [REF] weblate-component-too-long: Increase the value from 90 to 100 The real limit value for weblate is 100 --- README.md | 2 +- src/oca_pre_commit_hooks/checks_odoo_module.py | 2 +- tests/common.py | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c71efa6..6aa0b0f 100644 --- a/README.md +++ b/README.md @@ -408,7 +408,7 @@ options: * weblate-component-too-long - - https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.18/test_repo/syntax_err_module/__manifest__.py#L1 Repo Name + Odoo version + Module name is too long for weblate component 'big-big-big-big-big-big-big-big-big-big-big-big-big-big-big-big-big--00.0-syntax_err_module' size 91 is longer than 90 characters + - https://github.com/OCA/odoo-pre-commit-hooks/blob/v0.2.18/test_repo/syntax_err_module/__manifest__.py#L1 Repo Name + Odoo version + Module name is too long for weblate component 'biiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiig-00.0-syntax_err_module' size 101 is longer than 100 characters * xml-create-user-wo-reset-password diff --git a/src/oca_pre_commit_hooks/checks_odoo_module.py b/src/oca_pre_commit_hooks/checks_odoo_module.py index 4a8a447..547e8a0 100755 --- a/src/oca_pre_commit_hooks/checks_odoo_module.py +++ b/src/oca_pre_commit_hooks/checks_odoo_module.py @@ -37,7 +37,7 @@ ".csv", ".xml", ] -MAX_WEBLATE_NAME_LENGTH = 90 +MAX_WEBLATE_NAME_LENGTH = 100 DATA_MANUAL_KEY = "oca_data_manual" BLUE_PILL = "\033[94m🔵\033[0m" RED_PILL = "\033[91m🔴\033[0m" diff --git a/tests/common.py b/tests/common.py index 150307a..e24e734 100644 --- a/tests/common.py +++ b/tests/common.py @@ -11,6 +11,7 @@ import pytest from oca_pre_commit_hooks import utils +from oca_pre_commit_hooks.checks_odoo_module import MAX_WEBLATE_NAME_LENGTH from oca_pre_commit_hooks.global_parser import CONFIG_NAME, DISABLE_ENV_VAR, ENABLE_ENV_VAR RND = random.Random(987654321) @@ -41,7 +42,8 @@ def create_dummy_repo(src_path, dest_path): copy_tree(src_path, dest_path) subprocess.check_call(["git", "init", dest_path, "--initial-branch=main"]) subprocess.check_call(["git", "add", "*"], cwd=dest_path) - git_big_repo_name = "big-" * 17 + ".git" + git_big_repo_name = "b" + "i" * (MAX_WEBLATE_NAME_LENGTH - 24) + "g" + ".git" + subprocess.check_call( ["git", "remote", "add", "my_remote", f"git@github.com:/OCA/{git_big_repo_name}"], cwd=dest_path )