py-wlcli 0.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- py_wlcli-0.8.0.dist-info/METADATA +139 -0
- py_wlcli-0.8.0.dist-info/RECORD +320 -0
- py_wlcli-0.8.0.dist-info/WHEEL +4 -0
- py_wlcli-0.8.0.dist-info/entry_points.txt +2 -0
- py_wlcli-0.8.0.dist-info/licenses/LICENSE +21 -0
- wl_cli/__init__.py +27 -0
- wl_cli/__main__.py +130 -0
- wl_cli/capabilities.py +79 -0
- wl_cli/cc/__init__.py +5 -0
- wl_cli/cc/checks.py +1019 -0
- wl_cli/cc/cli.py +370 -0
- wl_cli/cc/mutate.py +1350 -0
- wl_cli/cli_click.py +156 -0
- wl_cli/commands/__init__.py +84 -0
- wl_cli/commands/base.py +80 -0
- wl_cli/commands/buildcommands/__init__.py +1 -0
- wl_cli/commands/buildcommands/build.py +71 -0
- wl_cli/commands/buildcommands/build_utils.py +47 -0
- wl_cli/commands/buildcommands/builders/__init__.py +18 -0
- wl_cli/commands/buildcommands/builders/cleanup.py +35 -0
- wl_cli/commands/buildcommands/builders/coordinator.py +122 -0
- wl_cli/commands/buildcommands/builders/environment.py +81 -0
- wl_cli/commands/buildcommands/builders/rust_builder.py +39 -0
- wl_cli/commands/buildcommands/builders/stubs.py +58 -0
- wl_cli/commands/buildcommands/dist.py +326 -0
- wl_cli/commands/buildcommands/test.py +89 -0
- wl_cli/commands/clean/__init__.py +1 -0
- wl_cli/commands/clean/build.py +151 -0
- wl_cli/commands/clean/clean.py +294 -0
- wl_cli/commands/clean/clean_utils.py +77 -0
- wl_cli/commands/clean/core.py +236 -0
- wl_cli/commands/clean/dead_code/__init__.py +0 -0
- wl_cli/commands/clean/dead_code/dead_code_command.py +70 -0
- wl_cli/commands/clean/dead_code/detector.py +161 -0
- wl_cli/commands/clean/dead_code/fixer.py +176 -0
- wl_cli/commands/clean/dead_code/reporter.py +295 -0
- wl_cli/commands/clean/dead_code/utils.py +0 -0
- wl_cli/commands/clean/lfs.py +215 -0
- wl_cli/commands/clean/python.py +81 -0
- wl_cli/commands/clean/rust.py +91 -0
- wl_cli/commands/clean/utils/__init__.py +34 -0
- wl_cli/commands/clean/venv.py +91 -0
- wl_cli/commands/cleanup.py +73 -0
- wl_cli/commands/click_base.py +79 -0
- wl_cli/commands/config/__init__.py +1 -0
- wl_cli/commands/config/config.py +291 -0
- wl_cli/commands/debug/__init__.py +6 -0
- wl_cli/commands/debug/debug.py +309 -0
- wl_cli/commands/debug/debug_cache.py +86 -0
- wl_cli/commands/debug/debug_subagent.py +156 -0
- wl_cli/commands/debug/output_formatter.py +165 -0
- wl_cli/commands/debug/source_hasher.py +92 -0
- wl_cli/commands/format/__init__.py +13 -0
- wl_cli/commands/format/format_cache_adapter.py +125 -0
- wl_cli/commands/format/format_command.py +197 -0
- wl_cli/commands/format/format_coordinator.py +191 -0
- wl_cli/commands/format/format_executor.py +470 -0
- wl_cli/commands/format/format_outcome.py +44 -0
- wl_cli/commands/format/format_path_handler.py +1016 -0
- wl_cli/commands/format/format_progress.py +62 -0
- wl_cli/commands/format/format_reporter.py +31 -0
- wl_cli/commands/format/python_formatter.py +506 -0
- wl_cli/commands/format/rust_formatter.py +106 -0
- wl_cli/commands/gate/__init__.py +1 -0
- wl_cli/commands/gate/gate_command.py +862 -0
- wl_cli/commands/gate/preflight.py +445 -0
- wl_cli/commands/git/__init__.py +1 -0
- wl_cli/commands/git/config.py +169 -0
- wl_cli/commands/git/git_facts.py +60 -0
- wl_cli/commands/git/git_flow.py +86 -0
- wl_cli/commands/git/hook.py +112 -0
- wl_cli/commands/git/policy.py +216 -0
- wl_cli/commands/git/push_update.py +82 -0
- wl_cli/commands/initenv/__init__.py +1 -0
- wl_cli/commands/initenv/common/__init__.py +23 -0
- wl_cli/commands/initenv/common/check_git_bash.py +78 -0
- wl_cli/commands/initenv/common/error_handler.py +68 -0
- wl_cli/commands/initenv/common/exceptions.py +52 -0
- wl_cli/commands/initenv/components/__init__.py +4 -0
- wl_cli/commands/initenv/components/cargo_sync.py +240 -0
- wl_cli/commands/initenv/components/config_manager.py +106 -0
- wl_cli/commands/initenv/components/directory_utils.py +71 -0
- wl_cli/commands/initenv/components/git/__init__.py +9 -0
- wl_cli/commands/initenv/components/git/branch_creator.py +143 -0
- wl_cli/commands/initenv/components/git/git_flow_interface.py +24 -0
- wl_cli/commands/initenv/components/git/git_flow_manager.py +159 -0
- wl_cli/commands/initenv/components/git/git_lfs_manager.py +272 -0
- wl_cli/commands/initenv/components/git/git_utility.py +254 -0
- wl_cli/commands/initenv/components/git/gitignore_manager.py +53 -0
- wl_cli/commands/initenv/components/git_initializer.py +212 -0
- wl_cli/commands/initenv/components/i18n_manager.py +104 -0
- wl_cli/commands/initenv/components/log_manager.py +241 -0
- wl_cli/commands/initenv/components/project_structure/__init__.py +23 -0
- wl_cli/commands/initenv/components/project_structure/config_generator.py +360 -0
- wl_cli/commands/initenv/components/project_structure/directory_creator.py +184 -0
- wl_cli/commands/initenv/components/project_structure/hook_source.py +110 -0
- wl_cli/commands/initenv/components/project_structure/hooks_manager.py +995 -0
- wl_cli/commands/initenv/components/project_structure/readme_handler.py +56 -0
- wl_cli/commands/initenv/components/project_structure/rust_files_handler.py +30 -0
- wl_cli/commands/initenv/components/project_structure/setup_handler.py +103 -0
- wl_cli/commands/initenv/components/project_structure/sop_generator.py +73 -0
- wl_cli/commands/initenv/components/project_structure/template_copier.py +104 -0
- wl_cli/commands/initenv/components/project_structure/template_manager.py +195 -0
- wl_cli/commands/initenv/components/pyproject_generator.py +194 -0
- wl_cli/commands/initenv/components/rust_initializer.py +145 -0
- wl_cli/commands/initenv/components/symlink_cleaner.py +99 -0
- wl_cli/commands/initenv/components/symlink_manager.py +52 -0
- wl_cli/commands/initenv/components/venv_manager.py +118 -0
- wl_cli/commands/initenv/initenv.py +169 -0
- wl_cli/commands/initenv/services/__init__.py +11 -0
- wl_cli/commands/initenv/services/environment_initializer.py +288 -0
- wl_cli/commands/initenv/services/git_lfs_initializer.py +26 -0
- wl_cli/commands/initenv/services/project_structure_initializer.py +52 -0
- wl_cli/commands/lfs/README.md +221 -0
- wl_cli/commands/lfs/__init__.py +5 -0
- wl_cli/commands/lfs/cli.py +106 -0
- wl_cli/commands/lfs/config.py +164 -0
- wl_cli/commands/lfs/hook.py +61 -0
- wl_cli/commands/lfs/initializer.py +531 -0
- wl_cli/commands/lfs/manager.py +95 -0
- wl_cli/commands/lfs/policy.py +165 -0
- wl_cli/commands/lfs/watcher.py +294 -0
- wl_cli/commands/lint/__init__.py +1 -0
- wl_cli/commands/lint/lint_command.py +297 -0
- wl_cli/commands/lint/lint_executor.py +409 -0
- wl_cli/commands/lint/lint_reporter.py +579 -0
- wl_cli/commands/lint/lint_run.py +258 -0
- wl_cli/commands/lint/mypy_config.py +90 -0
- wl_cli/commands/registry.py +103 -0
- wl_cli/commands/self/__init__.py +7 -0
- wl_cli/commands/self/common/__init__.py +8 -0
- wl_cli/commands/self/common/capabilities.py +30 -0
- wl_cli/commands/self/common/config.py +27 -0
- wl_cli/commands/self/common/version_cache.py +85 -0
- wl_cli/commands/self/handlers/__init__.py +19 -0
- wl_cli/commands/self/handlers/base_handler.py +28 -0
- wl_cli/commands/self/handlers/install_handler.py +85 -0
- wl_cli/commands/self/handlers/status_handler.py +66 -0
- wl_cli/commands/self/handlers/uninstall_handler.py +58 -0
- wl_cli/commands/self/handlers/update_handler.py +102 -0
- wl_cli/commands/self/handlers/version_handler.py +16 -0
- wl_cli/commands/self/self_command.py +237 -0
- wl_cli/commands/self/services/__init__.py +15 -0
- wl_cli/commands/self/services/installation_manager.py +187 -0
- wl_cli/commands/self/services/local_installer.py +165 -0
- wl_cli/commands/self/services/pypi_updater.py +278 -0
- wl_cli/commands/self/services/windows_update.py +174 -0
- wl_cli/commands/testcommands/__init__.py +8 -0
- wl_cli/commands/testcommands/base_dependency_analyzer.py +198 -0
- wl_cli/commands/testcommands/batch_processor.py +278 -0
- wl_cli/commands/testcommands/cache_manager.py +1156 -0
- wl_cli/commands/testcommands/coverage_analyzer.py +955 -0
- wl_cli/commands/testcommands/coverage_cache_manager.py +183 -0
- wl_cli/commands/testcommands/progress_manager.py +79 -0
- wl_cli/commands/testcommands/python_env_detector.py +207 -0
- wl_cli/commands/testcommands/report_generator.py +101 -0
- wl_cli/commands/testcommands/single_test_executor.py +250 -0
- wl_cli/commands/testcommands/speed_checker.py +118 -0
- wl_cli/commands/testcommands/test_command_builder.py +165 -0
- wl_cli/commands/testcommands/test_commands.py +786 -0
- wl_cli/commands/testcommands/test_reporter.py +181 -0
- wl_cli/commands/testcommands/test_result_handler.py +96 -0
- wl_cli/commands/testcommands/test_runner.py +1343 -0
- wl_cli/commands/testcommands/test_utils.py +197 -0
- wl_cli/commands/testcommands/utils/__init__.py +17 -0
- wl_cli/commands/testcommands/utils/coverage_parser.py +98 -0
- wl_cli/commands/testcommands/utils/env_info.py +36 -0
- wl_cli/commands/testcommands/utils/junit_parser.py +75 -0
- wl_cli/commands/testcommands/utils/markdown_utils.py +20 -0
- wl_cli/commands/testcommands/utils/project_root.py +61 -0
- wl_cli/commands/update/__init__.py +9 -0
- wl_cli/commands/update/services/__init__.py +21 -0
- wl_cli/commands/update/services/backup_manager.py +207 -0
- wl_cli/commands/update/services/component_manager.py +83 -0
- wl_cli/commands/update/services/conflict_resolver.py +189 -0
- wl_cli/commands/update/services/vendors_updater.py +85 -0
- wl_cli/commands/update/services/version_tracker.py +127 -0
- wl_cli/commands/update/update_command.py +270 -0
- wl_cli/commands/update/utils/__init__.py +3 -0
- wl_cli/commands/version/__init__.py +9 -0
- wl_cli/commands/version/version_command.py +155 -0
- wl_cli/commands/workflow.py +477 -0
- wl_cli/env/__init__.py +5 -0
- wl_cli/env/cli.py +167 -0
- wl_cli/env_status.py +157 -0
- wl_cli/envelope.py +91 -0
- wl_cli/exceptions.py +85 -0
- wl_cli/lib/__init__.py +3 -0
- wl_cli/lib/rust_utils.py +35 -0
- wl_cli/mcp/__init__.py +6 -0
- wl_cli/mcp/capabilities.py +19 -0
- wl_cli/mcp/cli.py +22 -0
- wl_cli/mcp/gitlab.py +553 -0
- wl_cli/mcp/k8s.py +344 -0
- wl_cli/mcp/protocol.py +159 -0
- wl_cli/platform.py +139 -0
- wl_cli/quality/__init__.py +18 -0
- wl_cli/utils/__init__.py +7 -0
- wl_cli/utils/cache.py +491 -0
- wl_cli/utils/cache_ledger.py +355 -0
- wl_cli/utils/cache_store.py +546 -0
- wl_cli/utils/config/__init__.py +27 -0
- wl_cli/utils/config/config_loader.py +163 -0
- wl_cli/utils/config/core.py +862 -0
- wl_cli/utils/config/defaults.py +142 -0
- wl_cli/utils/config/env_exporter.py +86 -0
- wl_cli/utils/config/env_parser.py +108 -0
- wl_cli/utils/config/validation.py +280 -0
- wl_cli/utils/error_handler.py +165 -0
- wl_cli/utils/file_copier.py +56 -0
- wl_cli/utils/file_operations.py +506 -0
- wl_cli/utils/language_utils.py +122 -0
- wl_cli/utils/lazy_import.py +240 -0
- wl_cli/utils/log_levels.py +35 -0
- wl_cli/utils/log_rotators.py +74 -0
- wl_cli/utils/logging.py +458 -0
- wl_cli/utils/output_context.py +142 -0
- wl_cli/utils/performance/__init__.py +1 -0
- wl_cli/utils/performance/decorators.py +111 -0
- wl_cli/utils/performance/exporter.py +38 -0
- wl_cli/utils/performance/models.py +16 -0
- wl_cli/utils/performance/monitor.py +161 -0
- wl_cli/utils/performance_monitor.py +32 -0
- wl_cli/utils/platform_adapter.py +131 -0
- wl_cli/utils/pre_commit.py +266 -0
- wl_cli/utils/pre_commit_config.py +72 -0
- wl_cli/utils/root.py +521 -0
- wl_cli/utils/root_fallback.py +256 -0
- wl_cli/utils/run_evidence.py +236 -0
- wl_cli/utils/structured_logger.py +18 -0
- wl_cli/utils/structured_logging/__init__.py +19 -0
- wl_cli/utils/structured_logging/config.py +337 -0
- wl_cli/utils/structured_logging/core.py +177 -0
- wl_cli/utils/structured_logging/env.py +56 -0
- wl_cli/utils/structured_logging/filtering.py +75 -0
- wl_cli/utils/structured_logging/filters.py +55 -0
- wl_cli/utils/structured_logging/formatters.py +251 -0
- wl_cli/utils/structured_logging/handlers.py +308 -0
- wl_cli/utils/structured_logging/logger.py +354 -0
- wl_cli/utils/subprocess.py +71 -0
- wl_cli/utils/subprocess_utils.py +260 -0
- wl_cli/utils/test_utils/__init__.py +5 -0
- wl_cli/utils/test_utils/test_filter.py +36 -0
- wl_cli/utils/uv_run.py +79 -0
- wl_cli/utils/uv_tool.py +117 -0
- wl_cli/utils/uv_tree.py +71 -0
- wl_cli/utils/uv_workspace.py +174 -0
- wl_cli/utils/version/__init__.py +15 -0
- wl_cli/utils/version/pypi_version_checker.py +95 -0
- wl_cli/utils/version/version_comparator.py +133 -0
- wl_cli/utils/version/version_detectors.py +312 -0
- wl_cli/utils/version/version_service.py +131 -0
- wl_cli/utils/version/version_updater.py +198 -0
- wl_cli/utils/wl_dir_updater.py +1440 -0
- wl_cli/utils/workspace_detector/__init__.py +28 -0
- wl_cli/utils/workspace_detector/core.py +161 -0
- wl_cli/utils/workspace_detector/detection_strategies.py +107 -0
- wl_cli/utils/workspace_detector/exceptions.py +5 -0
- wl_cli/utils/workspace_detector/types.py +17 -0
- wl_cli/utils/workspace_detector/venv_resolver.py +84 -0
- wl_cli/vendors/config/.codespellrc +2 -0
- wl_cli/vendors/config/dependencies.toml +10 -0
- wl_cli/vendors/config/mypy.ini +62 -0
- wl_cli/vendors/config/pyproject_defaults.toml +28 -0
- wl_cli/vendors/config/template_config.toml +24 -0
- wl_cli/vendors/config/tool_configs.toml +76 -0
- wl_cli/vendors/git/.gitignore +122 -0
- wl_cli/vendors/git/.pre-commit-config.yaml +37 -0
- wl_cli/vendors/hooks/applypatch-msg.sample +15 -0
- wl_cli/vendors/hooks/commit-msg.sample +24 -0
- wl_cli/vendors/hooks/fsmonitor-watchman.sample +174 -0
- wl_cli/vendors/hooks/post-update.sample +8 -0
- wl_cli/vendors/hooks/pre-applypatch.sample +14 -0
- wl_cli/vendors/hooks/pre-commit +45 -0
- wl_cli/vendors/hooks/pre-commit.legacy +31 -0
- wl_cli/vendors/hooks/pre-commit.sample +49 -0
- wl_cli/vendors/hooks/pre-merge-commit.sample +13 -0
- wl_cli/vendors/hooks/pre-push.sample +60 -0
- wl_cli/vendors/hooks/pre-rebase.sample +169 -0
- wl_cli/vendors/hooks/pre-receive.sample +24 -0
- wl_cli/vendors/hooks/prepare-commit-msg.sample +42 -0
- wl_cli/vendors/hooks/push-to-checkout.sample +78 -0
- wl_cli/vendors/hooks/sendemail-validate.sample +77 -0
- wl_cli/vendors/hooks/unix/applypatch-msg.sample +15 -0
- wl_cli/vendors/hooks/unix/check_lockfile.py +58 -0
- wl_cli/vendors/hooks/unix/check_lockfile.sh +36 -0
- wl_cli/vendors/hooks/unix/commit-msg.sample +24 -0
- wl_cli/vendors/hooks/unix/fsmonitor-watchman.sample +174 -0
- wl_cli/vendors/hooks/unix/post-update.sample +8 -0
- wl_cli/vendors/hooks/unix/pre-applypatch.sample +14 -0
- wl_cli/vendors/hooks/unix/pre-commit +190 -0
- wl_cli/vendors/hooks/unix/pre-commit.legacy +31 -0
- wl_cli/vendors/hooks/unix/pre-commit.py +81 -0
- wl_cli/vendors/hooks/unix/pre-commit.sample +49 -0
- wl_cli/vendors/hooks/unix/pre-merge-commit.sample +13 -0
- wl_cli/vendors/hooks/unix/pre-push +417 -0
- wl_cli/vendors/hooks/unix/pre-push.sample +53 -0
- wl_cli/vendors/hooks/unix/pre-rebase.sample +169 -0
- wl_cli/vendors/hooks/unix/pre-receive.sample +24 -0
- wl_cli/vendors/hooks/unix/prepare-commit-msg.sample +42 -0
- wl_cli/vendors/hooks/update.sample +128 -0
- wl_cli/vendors/hooks/win/work.bat +63 -0
- wl_cli/vendors/project/.gitignore +90 -0
- wl_cli/vendors/project/.python-version +1 -0
- wl_cli/vendors/project/LICENSE +21 -0
- wl_cli/vendors/project/README.md +0 -0
- wl_cli/vendors/project/pyproject.toml +27 -0
- wl_cli/vendors/project/pyproject_no_workspace.toml +16 -0
- wl_cli/vendors/project/pyproject_workspace.toml +14 -0
- wl_cli/vendors/readme/README.md +120 -0
- wl_cli/vendors/rust/Cargo.toml +14 -0
- wl_cli/vendors/rust/lib/__init__.py +3 -0
- wl_cli/vendors/rust/lib/rust_utils.py +31 -0
- wl_cli/vendors/rust/src/lib.rs +13 -0
- wl_cli/vendors/rust/src/main.rs +3 -0
- wl_cli/vendors/rust/tests/test_rust_fallback.py +40 -0
- wl_cli/vendors/sop_doc/git-dev-sop.md +220 -0
- wl_cli/vendors/sop_doc/industrial-standard-sop.md +145 -0
- wl_cli/vendors/sop_doc/python-sop.md +342 -0
- wl_cli/vendors/sop_doc/rust-readme.md +219 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Python 相关文件
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.so
|
|
5
|
+
*.dll
|
|
6
|
+
*.dylib
|
|
7
|
+
*.pyd
|
|
8
|
+
*.egg-info/
|
|
9
|
+
.pytest_cache/
|
|
10
|
+
.coverage
|
|
11
|
+
htmlcov/
|
|
12
|
+
.tox/
|
|
13
|
+
.hypothesis/
|
|
14
|
+
.cache/
|
|
15
|
+
.pre-commit-config.yaml
|
|
16
|
+
|
|
17
|
+
.wl/
|
|
18
|
+
.coveragerc
|
|
19
|
+
.python-version
|
|
20
|
+
|
|
21
|
+
# 构建目录
|
|
22
|
+
build/
|
|
23
|
+
dist/
|
|
24
|
+
wheels/
|
|
25
|
+
target/
|
|
26
|
+
rust/target/
|
|
27
|
+
|
|
28
|
+
# 虚拟环境
|
|
29
|
+
.venv/
|
|
30
|
+
env/
|
|
31
|
+
venv/
|
|
32
|
+
ENV/
|
|
33
|
+
|
|
34
|
+
# 依赖管理
|
|
35
|
+
Cargo.lock
|
|
36
|
+
uv.lock
|
|
37
|
+
.uv/
|
|
38
|
+
.uv_cache/
|
|
39
|
+
.ruff_cache/
|
|
40
|
+
.mypy_cache/
|
|
41
|
+
|
|
42
|
+
# IDE 和编辑器
|
|
43
|
+
.idea/
|
|
44
|
+
.vscode/
|
|
45
|
+
.cursor/
|
|
46
|
+
.lingma/
|
|
47
|
+
.vs/
|
|
48
|
+
*.swp
|
|
49
|
+
*.swo
|
|
50
|
+
.python-version
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
# 临时文件和系统文件
|
|
54
|
+
.DS_Store
|
|
55
|
+
|
|
56
|
+
# 图像和媒体文件
|
|
57
|
+
*.png
|
|
58
|
+
*.jpg
|
|
59
|
+
*.pdf
|
|
60
|
+
|
|
61
|
+
# Jupyter 文件
|
|
62
|
+
.ipynb_checkpoints/
|
|
63
|
+
|
|
64
|
+
# 日志和数据文件
|
|
65
|
+
*.log
|
|
66
|
+
logs/
|
|
67
|
+
results/
|
|
68
|
+
|
|
69
|
+
# 本地配置
|
|
70
|
+
.env
|
|
71
|
+
.env.local
|
|
72
|
+
auto_activate_venv.sh
|
|
73
|
+
deactivate_temp.sh
|
|
74
|
+
tools/auto_activate_venv.sh
|
|
75
|
+
|
|
76
|
+
# 工具和脚本(本地使用,不加入版本控制)
|
|
77
|
+
tools/
|
|
78
|
+
Makefile
|
|
79
|
+
todos/
|
|
80
|
+
|
|
81
|
+
# 示例文件夹(通常不加入版本控制)
|
|
82
|
+
# examples/
|
|
83
|
+
|
|
84
|
+
# 测试文件夹(通常加入版本控制)
|
|
85
|
+
# test/
|
|
86
|
+
output/
|
|
87
|
+
.history/
|
|
88
|
+
|
|
89
|
+
rust/target/
|
|
90
|
+
rust/.cargo/
|
|
91
|
+
Cargo.lock
|
|
92
|
+
typings/
|
|
93
|
+
|
|
94
|
+
examples/output*
|
|
95
|
+
|
|
96
|
+
# Added by Task Master AI
|
|
97
|
+
# Logs
|
|
98
|
+
logs
|
|
99
|
+
npm-debug.log*
|
|
100
|
+
yarn-debug.log*
|
|
101
|
+
yarn-error.log*
|
|
102
|
+
dev-debug.log
|
|
103
|
+
# Dependency directories
|
|
104
|
+
node_modules/
|
|
105
|
+
# Environment variables
|
|
106
|
+
# Editor directories and files
|
|
107
|
+
.idea
|
|
108
|
+
.vscode
|
|
109
|
+
*.suo
|
|
110
|
+
*.ntvs*
|
|
111
|
+
*.njsproj
|
|
112
|
+
*.sln
|
|
113
|
+
*.sw?
|
|
114
|
+
# OS specific
|
|
115
|
+
# Task files
|
|
116
|
+
tasks.json
|
|
117
|
+
tasks/
|
|
118
|
+
vendors/
|
|
119
|
+
**/*.token
|
|
120
|
+
|
|
121
|
+
# worktrees (see git-dev-sop §1.1)
|
|
122
|
+
.worktrees/
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
3
|
+
rev: v0.15.21
|
|
4
|
+
hooks:
|
|
5
|
+
- id: ruff
|
|
6
|
+
args: [--ignore, S607]
|
|
7
|
+
- id: ruff-format
|
|
8
|
+
|
|
9
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
10
|
+
rev: v4.6.0
|
|
11
|
+
hooks:
|
|
12
|
+
- id: check-ast
|
|
13
|
+
- id: check-yaml
|
|
14
|
+
- id: end-of-file-fixer
|
|
15
|
+
- id: trailing-whitespace
|
|
16
|
+
|
|
17
|
+
- repo: https://github.com/codespell-project/codespell
|
|
18
|
+
rev: v2.3.0
|
|
19
|
+
hooks:
|
|
20
|
+
- id: codespell
|
|
21
|
+
args: [--config, .wl/.codespellrc]
|
|
22
|
+
exclude: "^src/wl_cli/vendors/"
|
|
23
|
+
|
|
24
|
+
- repo: https://github.com/gitleaks/gitleaks
|
|
25
|
+
rev: v8.30.1
|
|
26
|
+
hooks:
|
|
27
|
+
- id: gitleaks # secret/credential scan on staged changes (IS-4)
|
|
28
|
+
|
|
29
|
+
- repo: local
|
|
30
|
+
hooks:
|
|
31
|
+
- id: check-lockfile
|
|
32
|
+
name: Check uv.lock consistency and update if needed
|
|
33
|
+
entry: .wl/hooks/check_lockfile.py
|
|
34
|
+
language: system
|
|
35
|
+
pass_filenames: false
|
|
36
|
+
always_run: true
|
|
37
|
+
types: [python]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
#
|
|
3
|
+
# An example hook script to check the commit log message taken by
|
|
4
|
+
# applypatch from an e-mail message.
|
|
5
|
+
#
|
|
6
|
+
# The hook should exit with non-zero status after issuing an
|
|
7
|
+
# appropriate message if it wants to stop the commit. The hook is
|
|
8
|
+
# allowed to edit the commit message file.
|
|
9
|
+
#
|
|
10
|
+
# To enable this hook, rename this file to "applypatch-msg".
|
|
11
|
+
|
|
12
|
+
. git-sh-setup
|
|
13
|
+
commitmsg="$(git rev-parse --git-path hooks/commit-msg)"
|
|
14
|
+
test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"}
|
|
15
|
+
:
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
#
|
|
3
|
+
# An example hook script to check the commit log message.
|
|
4
|
+
# Called by "git commit" with one argument, the name of the file
|
|
5
|
+
# that has the commit message. The hook should exit with non-zero
|
|
6
|
+
# status after issuing an appropriate message if it wants to stop the
|
|
7
|
+
# commit. The hook is allowed to edit the commit message file.
|
|
8
|
+
#
|
|
9
|
+
# To enable this hook, rename this file to "commit-msg".
|
|
10
|
+
|
|
11
|
+
# Uncomment the below to add a Signed-off-by line to the message.
|
|
12
|
+
# Doing this in a hook is a bad idea in general, but the prepare-commit-msg
|
|
13
|
+
# hook is more suited to it.
|
|
14
|
+
#
|
|
15
|
+
# SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p')
|
|
16
|
+
# grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1"
|
|
17
|
+
|
|
18
|
+
# This example catches duplicate Signed-off-by lines.
|
|
19
|
+
|
|
20
|
+
test "" = "$(grep '^Signed-off-by: ' "$1" |
|
|
21
|
+
sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || {
|
|
22
|
+
echo >&2 Duplicate Signed-off-by lines.
|
|
23
|
+
exit 1
|
|
24
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
#!/usr/bin/perl
|
|
2
|
+
|
|
3
|
+
use strict;
|
|
4
|
+
use warnings;
|
|
5
|
+
use IPC::Open2;
|
|
6
|
+
|
|
7
|
+
# An example hook script to integrate Watchman
|
|
8
|
+
# (https://facebook.github.io/watchman/) with git to speed up detecting
|
|
9
|
+
# new and modified files.
|
|
10
|
+
#
|
|
11
|
+
# The hook is passed a version (currently 2) and last update token
|
|
12
|
+
# formatted as a string and outputs to stdout a new update token and
|
|
13
|
+
# all files that have been modified since the update token. Paths must
|
|
14
|
+
# be relative to the root of the working tree and separated by a single NUL.
|
|
15
|
+
#
|
|
16
|
+
# To enable this hook, rename this file to "query-watchman" and set
|
|
17
|
+
# 'git config core.fsmonitor .git/hooks/query-watchman'
|
|
18
|
+
#
|
|
19
|
+
my ($version, $last_update_token) = @ARGV;
|
|
20
|
+
|
|
21
|
+
# Uncomment for debugging
|
|
22
|
+
# print STDERR "$0 $version $last_update_token\n";
|
|
23
|
+
|
|
24
|
+
# Check the hook interface version
|
|
25
|
+
if ($version ne 2) {
|
|
26
|
+
die "Unsupported query-fsmonitor hook version '$version'.\n" .
|
|
27
|
+
"Falling back to scanning...\n";
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
my $git_work_tree = get_working_dir();
|
|
31
|
+
|
|
32
|
+
my $retry = 1;
|
|
33
|
+
|
|
34
|
+
my $json_pkg;
|
|
35
|
+
eval {
|
|
36
|
+
require JSON::XS;
|
|
37
|
+
$json_pkg = "JSON::XS";
|
|
38
|
+
1;
|
|
39
|
+
} or do {
|
|
40
|
+
require JSON::PP;
|
|
41
|
+
$json_pkg = "JSON::PP";
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
launch_watchman();
|
|
45
|
+
|
|
46
|
+
sub launch_watchman {
|
|
47
|
+
my $o = watchman_query();
|
|
48
|
+
if (is_work_tree_watched($o)) {
|
|
49
|
+
output_result($o->{clock}, @{$o->{files}});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
sub output_result {
|
|
54
|
+
my ($clockid, @files) = @_;
|
|
55
|
+
|
|
56
|
+
# Uncomment for debugging watchman output
|
|
57
|
+
# open (my $fh, ">", ".git/watchman-output.out");
|
|
58
|
+
# binmode $fh, ":utf8";
|
|
59
|
+
# print $fh "$clockid\n@files\n";
|
|
60
|
+
# close $fh;
|
|
61
|
+
|
|
62
|
+
binmode STDOUT, ":utf8";
|
|
63
|
+
print $clockid;
|
|
64
|
+
print "\0";
|
|
65
|
+
local $, = "\0";
|
|
66
|
+
print @files;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
sub watchman_clock {
|
|
70
|
+
my $response = qx/watchman clock "$git_work_tree"/;
|
|
71
|
+
die "Failed to get clock id on '$git_work_tree'.\n" .
|
|
72
|
+
"Falling back to scanning...\n" if $? != 0;
|
|
73
|
+
|
|
74
|
+
return $json_pkg->new->utf8->decode($response);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
sub watchman_query {
|
|
78
|
+
my $pid = open2(\*CHLD_OUT, \*CHLD_IN, 'watchman -j --no-pretty')
|
|
79
|
+
or die "open2() failed: $!\n" .
|
|
80
|
+
"Falling back to scanning...\n";
|
|
81
|
+
|
|
82
|
+
# In the query expression below we're asking for names of files that
|
|
83
|
+
# changed since $last_update_token but not from the .git folder.
|
|
84
|
+
#
|
|
85
|
+
# To accomplish this, we're using the "since" generator to use the
|
|
86
|
+
# recency index to select candidate nodes and "fields" to limit the
|
|
87
|
+
# output to file names only. Then we're using the "expression" term to
|
|
88
|
+
# further constrain the results.
|
|
89
|
+
my $last_update_line = "";
|
|
90
|
+
if (substr($last_update_token, 0, 1) eq "c") {
|
|
91
|
+
$last_update_token = "\"$last_update_token\"";
|
|
92
|
+
$last_update_line = qq[\n"since": $last_update_token,];
|
|
93
|
+
}
|
|
94
|
+
my $query = <<" END";
|
|
95
|
+
["query", "$git_work_tree", {$last_update_line
|
|
96
|
+
"fields": ["name"],
|
|
97
|
+
"expression": ["not", ["dirname", ".git"]]
|
|
98
|
+
}]
|
|
99
|
+
END
|
|
100
|
+
|
|
101
|
+
# Uncomment for debugging the watchman query
|
|
102
|
+
# open (my $fh, ">", ".git/watchman-query.json");
|
|
103
|
+
# print $fh $query;
|
|
104
|
+
# close $fh;
|
|
105
|
+
|
|
106
|
+
print CHLD_IN $query;
|
|
107
|
+
close CHLD_IN;
|
|
108
|
+
my $response = do {local $/; <CHLD_OUT>};
|
|
109
|
+
|
|
110
|
+
# Uncomment for debugging the watch response
|
|
111
|
+
# open ($fh, ">", ".git/watchman-response.json");
|
|
112
|
+
# print $fh $response;
|
|
113
|
+
# close $fh;
|
|
114
|
+
|
|
115
|
+
die "Watchman: command returned no output.\n" .
|
|
116
|
+
"Falling back to scanning...\n" if $response eq "";
|
|
117
|
+
die "Watchman: command returned invalid output: $response\n" .
|
|
118
|
+
"Falling back to scanning...\n" unless $response =~ /^\{/;
|
|
119
|
+
|
|
120
|
+
return $json_pkg->new->utf8->decode($response);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
sub is_work_tree_watched {
|
|
124
|
+
my ($output) = @_;
|
|
125
|
+
my $error = $output->{error};
|
|
126
|
+
if ($retry > 0 and $error and $error =~ m/unable to resolve root .* directory (.*) is not watched/) {
|
|
127
|
+
$retry--;
|
|
128
|
+
my $response = qx/watchman watch "$git_work_tree"/;
|
|
129
|
+
die "Failed to make watchman watch '$git_work_tree'.\n" .
|
|
130
|
+
"Falling back to scanning...\n" if $? != 0;
|
|
131
|
+
$output = $json_pkg->new->utf8->decode($response);
|
|
132
|
+
$error = $output->{error};
|
|
133
|
+
die "Watchman: $error.\n" .
|
|
134
|
+
"Falling back to scanning...\n" if $error;
|
|
135
|
+
|
|
136
|
+
# Uncomment for debugging watchman output
|
|
137
|
+
# open (my $fh, ">", ".git/watchman-output.out");
|
|
138
|
+
# close $fh;
|
|
139
|
+
|
|
140
|
+
# Watchman will always return all files on the first query so
|
|
141
|
+
# return the fast "everything is dirty" flag to git and do the
|
|
142
|
+
# Watchman query just to get it over with now so we won't pay
|
|
143
|
+
# the cost in git to look up each individual file.
|
|
144
|
+
my $o = watchman_clock();
|
|
145
|
+
$error = $output->{error};
|
|
146
|
+
|
|
147
|
+
die "Watchman: $error.\n" .
|
|
148
|
+
"Falling back to scanning...\n" if $error;
|
|
149
|
+
|
|
150
|
+
output_result($o->{clock}, ("/"));
|
|
151
|
+
$last_update_token = $o->{clock};
|
|
152
|
+
|
|
153
|
+
eval { launch_watchman() };
|
|
154
|
+
return 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
die "Watchman: $error.\n" .
|
|
158
|
+
"Falling back to scanning...\n" if $error;
|
|
159
|
+
|
|
160
|
+
return 1;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
sub get_working_dir {
|
|
164
|
+
my $working_dir;
|
|
165
|
+
if ($^O =~ 'msys' || $^O =~ 'cygwin') {
|
|
166
|
+
$working_dir = Win32::GetCwd();
|
|
167
|
+
$working_dir =~ tr/\\/\//;
|
|
168
|
+
} else {
|
|
169
|
+
require Cwd;
|
|
170
|
+
$working_dir = Cwd::cwd();
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return $working_dir;
|
|
174
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
#
|
|
3
|
+
# An example hook script to verify what is about to be committed
|
|
4
|
+
# by applypatch from an e-mail message.
|
|
5
|
+
#
|
|
6
|
+
# The hook should exit with non-zero status after issuing an
|
|
7
|
+
# appropriate message if it wants to stop the commit.
|
|
8
|
+
#
|
|
9
|
+
# To enable this hook, rename this file to "pre-applypatch".
|
|
10
|
+
|
|
11
|
+
. git-sh-setup
|
|
12
|
+
precommit="$(git rev-parse --git-path hooks/pre-commit)"
|
|
13
|
+
test -x "$precommit" && exec "$precommit" ${1+"$@"}
|
|
14
|
+
:
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# File generated by pre-commit: https://pre-commit.com
|
|
3
|
+
# ID: 138fd403232d2ddd5efb44317e38bf03
|
|
4
|
+
# Modified to use relative paths instead of hardcoded paths
|
|
5
|
+
# Added Git Flow hint display
|
|
6
|
+
|
|
7
|
+
# Run git-flow check and display hint information
|
|
8
|
+
run_git_flow_check() {
|
|
9
|
+
if command -v uv > /dev/null 2>&1; then
|
|
10
|
+
echo ""
|
|
11
|
+
echo "=== Git Flow Status ==="
|
|
12
|
+
echo "=== Git Flow 状态 ==="
|
|
13
|
+
uv run wl git-flow check 2>/dev/null | grep -E "^(Git Flow check:|Branch:|Type:|Source:|Target:|Rule:|Fix:|Config:)"
|
|
14
|
+
echo "=============================="
|
|
15
|
+
fi
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
# start templated
|
|
19
|
+
# Try to detect Python from common virtual environments
|
|
20
|
+
venv_paths=("./.venv/bin/python" "./.venv/bin/python3" "../.venv/bin/python" "../.venv/bin/python3" "../../.venv/bin/python" "../../.venv/bin/python3")
|
|
21
|
+
args=(hook-impl --config=.wl/.pre-commit-config.yaml --hook-type=pre-commit)
|
|
22
|
+
# end templated
|
|
23
|
+
|
|
24
|
+
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
25
|
+
args+=(--hook-dir "$HERE" -- "$@")
|
|
26
|
+
|
|
27
|
+
# Run Git Flow check before pre-commit
|
|
28
|
+
run_git_flow_check
|
|
29
|
+
|
|
30
|
+
# Try to find the Python executable in virtual environments
|
|
31
|
+
for PYTHON in "${venv_paths[@]}"; do
|
|
32
|
+
if [ -x "$PYTHON" ]; then
|
|
33
|
+
exec "$PYTHON" -mpre_commit "${args[@]}"
|
|
34
|
+
exit 0
|
|
35
|
+
fi
|
|
36
|
+
done
|
|
37
|
+
|
|
38
|
+
# If no virtual environment Python found, try system pre-commit
|
|
39
|
+
if command -v pre-commit > /dev/null; then
|
|
40
|
+
exec pre-commit "${args[@]}" 2>&1
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
# If all fails, show error message
|
|
44
|
+
echo '`pre-commit` not found. Did you forget to activate your virtualenv?' 1>&2
|
|
45
|
+
exit 1
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Pre-commit hook that prevents commits to main and develop branches and runs wl lint
|
|
4
|
+
|
|
5
|
+
# Check current branch
|
|
6
|
+
echo "Checking current branch..."
|
|
7
|
+
current_branch=$(git branch --show-current)
|
|
8
|
+
|
|
9
|
+
# Prevent commits to main and develop branches
|
|
10
|
+
if [[ "$current_branch" == "main" || "$current_branch" == "develop" ]]; then
|
|
11
|
+
echo "❌ ERROR: Direct commits to $current_branch branch are not allowed."
|
|
12
|
+
echo "Please create a feature/fix branch and submit a Pull Request instead."
|
|
13
|
+
exit 1
|
|
14
|
+
fi
|
|
15
|
+
|
|
16
|
+
echo "Running pre-commit checks..."
|
|
17
|
+
echo "执行预提交检查..."
|
|
18
|
+
|
|
19
|
+
# Run wl lint command with custom pre-commit config
|
|
20
|
+
uv run wl lint --pre-commit-config config/.pre-commit-config.yaml
|
|
21
|
+
|
|
22
|
+
# Check exit code
|
|
23
|
+
if [ $? -ne 0 ]; then
|
|
24
|
+
echo "❌ Pre-commit checks failed. Please fix the issues and try again."
|
|
25
|
+
echo "❌ 预提交检查失败。请修复问题后重试。"
|
|
26
|
+
exit 1
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
echo "✅ Pre-commit checks passed."
|
|
30
|
+
echo "✅ 预提交检查通过。"
|
|
31
|
+
exit 0
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
#
|
|
3
|
+
# An example hook script to verify what is about to be committed.
|
|
4
|
+
# Called by "git commit" with no arguments. The hook should
|
|
5
|
+
# exit with non-zero status after issuing an appropriate message if
|
|
6
|
+
# it wants to stop the commit.
|
|
7
|
+
#
|
|
8
|
+
# To enable this hook, rename this file to "pre-commit".
|
|
9
|
+
|
|
10
|
+
if git rev-parse --verify HEAD >/dev/null 2>&1
|
|
11
|
+
then
|
|
12
|
+
against=HEAD
|
|
13
|
+
else
|
|
14
|
+
# Initial commit: diff against an empty tree object
|
|
15
|
+
against=$(git hash-object -t tree /dev/null)
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
# If you want to allow non-ASCII filenames set this variable to true.
|
|
19
|
+
allownonascii=$(git config --type=bool hooks.allownonascii)
|
|
20
|
+
|
|
21
|
+
# Redirect output to stderr.
|
|
22
|
+
exec 1>&2
|
|
23
|
+
|
|
24
|
+
# Cross platform projects tend to avoid non-ASCII filenames; prevent
|
|
25
|
+
# them from being added to the repository. We exploit the fact that the
|
|
26
|
+
# printable range starts at the space character and ends with tilde.
|
|
27
|
+
if [ "$allownonascii" != "true" ] &&
|
|
28
|
+
# Note that the use of brackets around a tr range is ok here, (it's
|
|
29
|
+
# even required, for portability to Solaris 10's /usr/bin/tr), since
|
|
30
|
+
# the square bracket bytes happen to fall in the designated range.
|
|
31
|
+
test $(git diff-index --cached --name-only --diff-filter=A -z $against |
|
|
32
|
+
LC_ALL=C tr -d '[ -~]\0' | wc -c) != 0
|
|
33
|
+
then
|
|
34
|
+
cat <<\EOF
|
|
35
|
+
Error: Attempt to add a non-ASCII file name.
|
|
36
|
+
|
|
37
|
+
This can cause problems if you want to work with people on other platforms.
|
|
38
|
+
|
|
39
|
+
To be portable it is advisable to rename the file.
|
|
40
|
+
|
|
41
|
+
If you know what you are doing you can disable this check using:
|
|
42
|
+
|
|
43
|
+
git config hooks.allownonascii true
|
|
44
|
+
EOF
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
|
|
48
|
+
# If there are whitespace errors, print the offending file names and fail.
|
|
49
|
+
exec git diff-index --check --cached $against --
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
#
|
|
3
|
+
# An example hook script to verify what is about to be committed.
|
|
4
|
+
# Called by "git merge" with no arguments. The hook should
|
|
5
|
+
# exit with non-zero status after issuing an appropriate message to
|
|
6
|
+
# stderr if it wants to stop the merge commit.
|
|
7
|
+
#
|
|
8
|
+
# To enable this hook, rename this file to "pre-merge-commit".
|
|
9
|
+
|
|
10
|
+
. git-sh-setup
|
|
11
|
+
test -x "$GIT_DIR/hooks/pre-commit" &&
|
|
12
|
+
exec "$GIT_DIR/hooks/pre-commit"
|
|
13
|
+
:
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
# Block --no-verify and -n options to enforce code quality checks
|
|
4
|
+
if echo "$*" | grep -q '\(--no-verify\| -n\)'; then
|
|
5
|
+
echo "Error: Using --no-verify or -n to skip pre-push hooks is not allowed." >&2
|
|
6
|
+
echo "Please ensure your code passes all quality checks before pushing." >&2
|
|
7
|
+
exit 1
|
|
8
|
+
fi
|
|
9
|
+
|
|
10
|
+
# An example hook script to verify what is about to be pushed. Called by "git
|
|
11
|
+
# push" after it has checked the remote status, but before anything has been
|
|
12
|
+
# pushed. If this script exits with a non-zero status nothing will be pushed.
|
|
13
|
+
#
|
|
14
|
+
# This hook is called with the following parameters:
|
|
15
|
+
#
|
|
16
|
+
# $1 -- Name of the remote to which the push is being done
|
|
17
|
+
# $2 -- URL to which the push is being done
|
|
18
|
+
#
|
|
19
|
+
# If pushing without using a named remote those arguments will be equal.
|
|
20
|
+
#
|
|
21
|
+
# Information about the commits which are being pushed is supplied as lines to
|
|
22
|
+
# the standard input in the form:
|
|
23
|
+
#
|
|
24
|
+
# <local ref> <local oid> <remote ref> <remote oid>
|
|
25
|
+
#
|
|
26
|
+
# This sample shows how to prevent push of commits where the log message starts
|
|
27
|
+
# with "WIP" (work in progress).
|
|
28
|
+
|
|
29
|
+
remote="$1"
|
|
30
|
+
url="$2"
|
|
31
|
+
|
|
32
|
+
zero=$(git hash-object --stdin </dev/null | tr '[0-9a-f]' '0')
|
|
33
|
+
|
|
34
|
+
while read local_ref local_oid remote_ref remote_oid
|
|
35
|
+
do
|
|
36
|
+
if test "$local_oid" = "$zero"
|
|
37
|
+
then
|
|
38
|
+
# Handle delete
|
|
39
|
+
:
|
|
40
|
+
else
|
|
41
|
+
if test "$remote_oid" = "$zero"
|
|
42
|
+
then
|
|
43
|
+
# New branch, examine all commits
|
|
44
|
+
range="$local_oid"
|
|
45
|
+
else
|
|
46
|
+
# Update to existing branch, examine new commits
|
|
47
|
+
range="$remote_oid..$local_oid"
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
# Check for WIP commit
|
|
51
|
+
commit=$(git rev-list -n 1 --grep '^WIP' "$range")
|
|
52
|
+
if test -n "$commit"
|
|
53
|
+
then
|
|
54
|
+
echo >&2 "Found WIP commit in $local_ref, not pushing"
|
|
55
|
+
exit 1
|
|
56
|
+
fi
|
|
57
|
+
fi
|
|
58
|
+
done
|
|
59
|
+
|
|
60
|
+
exit 0
|