diff --git a/README.md b/README.md index c71efa67..6aa0b0fd 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 4a8a447a..547e8a05 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 150307a2..e24e7349 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 )