blockwatch-cli 0.16.5__tar.gz → 0.16.7__tar.gz
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.
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/AGENTS.md +1 -1
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/CHANGELOG.md +35 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/CLAUDE.md +1 -1
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/Cargo.lock +1 -1
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/Cargo.toml +1 -1
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/PKG-INFO +1 -1
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/README.md +5 -4
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/blockwatch.toml +1 -1
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/docs/ci.md +2 -2
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/docs/cli.md +3 -3
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/docs/symbols.md +254 -27
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/setup.py +1 -1
- blockwatch_cli-0.16.7/src/language_parsers/bash.rs +553 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/mod.rs +22 -3
- blockwatch_cli-0.16.7/src/language_parsers/php.rs +1382 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/python.rs +91 -13
- blockwatch_cli-0.16.7/src/language_parsers/xml.rs +753 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/skill.md +66 -9
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/symbols/code.rs +8 -4
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/symbols/mod.rs +463 -95
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/symbol_references.rs +35 -0
- blockwatch_cli-0.16.7/tests/testdata/symbol_references/csproj_source.rs +3 -0
- blockwatch_cli-0.16.7/tests/testdata/symbol_references/csproj_target.csproj +6 -0
- blockwatch_cli-0.16.7/tests/testdata/symbol_references/php_source.rs +3 -0
- blockwatch_cli-0.16.7/tests/testdata/symbol_references/php_target.php +7 -0
- blockwatch_cli-0.16.7/tests/testdata/symbol_references/phtml_source.rs +3 -0
- blockwatch_cli-0.16.7/tests/testdata/symbol_references/phtml_target.phtml +4 -0
- blockwatch_cli-0.16.7/tests/testdata/symbol_references/sh_source.rs +3 -0
- blockwatch_cli-0.16.7/tests/testdata/symbol_references/sh_target.sh +2 -0
- blockwatch_cli-0.16.7/tests/testdata/symbol_references/xml_source.rs +3 -0
- blockwatch_cli-0.16.7/tests/testdata/symbol_references/xml_target.xml +12 -0
- blockwatch_cli-0.16.5/src/language_parsers/bash.rs +0 -94
- blockwatch_cli-0.16.5/src/language_parsers/php.rs +0 -284
- blockwatch_cli-0.16.5/src/language_parsers/xml.rs +0 -70
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/.agents/.claude-plugin/plugin.json +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/.agents/skills/blockwatch/SKILL.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/.claude-plugin/marketplace.json +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/.github/dependabot.yml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/.github/workflows/blockwatch.yml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/.github/workflows/codeql.yml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/.github/workflows/markdownlint.yml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/.github/workflows/pypi.yml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/.github/workflows/release.yml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/.github/workflows/rust.yml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/.github/workflows/trusted-checks.yml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/.gitignore +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/.markdownlint-cli2.yaml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/.pre-commit-config.yaml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/.pre-commit-hooks.yaml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/LICENSE +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/SECURITY.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/clippy.toml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/codecov.yml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/demo.gif +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/dist-workspace.toml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/docs/agents.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/docs/validators/README.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/docs/validators/affects.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/docs/validators/check-ai.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/docs/validators/check-lua.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/docs/validators/keep-sorted.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/docs/validators/keep-unique.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/docs/validators/line-count.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/docs/validators/line-pattern.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/docs/validators/same-as.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/pypi/pyproject.toml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/pyproject.toml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/release.toml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/scripts/check_language_count.lua +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/scripts/check_latest_gpt_nano_model.lua +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/block_parser.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/blocks.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/cli.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/config.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/diff_parser.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/explain.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/flags.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/fs.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/c.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/c_sharp.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/cmake.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/cpp.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/css.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/dart.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/dockerfile.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/elixir.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/go.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/graphql.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/groovy.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/hcl.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/html.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/java.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/javascript.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/json.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/kotlin.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/lean.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/lua.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/makefile.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/markdown.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/mdx.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/nix.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/ocaml.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/proto.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/ruby.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/rust.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/scala.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/sql.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/starlark.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/swift.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/toml.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/tsx.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/typescript.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/language_parsers/yaml.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/lib.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/main.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/path_arguments.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/paths_glob.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/repo_path.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/report.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/sarif.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/scan.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/settings.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/symbol_path.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/tag_parser.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/target_reference.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/validators/affects.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/validators/check_ai.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/validators/check_lua.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/validators/keep_sorted.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/validators/keep_unique.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/validators/line_count.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/validators/line_pattern.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/validators/mod.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/validators/same_as.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/violation_address.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/src/virtual_blocks.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/affects.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/check_ai.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/check_lua.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/common/empty.toml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/common/mod.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/config.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/encoding.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/explain.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/general.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/keep_sorted.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/keep_unique.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/line_count.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/line_pattern.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/list.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/path_arguments.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/repository_root.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/same_as.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/sarif.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/skill.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/suppressions.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/cross_file_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/cross_file_target.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/custom_ext_source.javascript +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/custom_ext_target.javascript +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/dangling.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/missing_symbol.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/more_added_than_deleted.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/multiline_tag_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/multiline_tag_target.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/nested_mapping_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/nested_mapping_target.yaml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/sibling.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/symbol_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/symbol_target.json +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/table_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/table_target.toml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/tag_and_content_source.ts +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/tag_and_content_target.ts +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/whole_file_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/affects/whole_file_target.json +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/check_ai/two_blocks.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/check_lua/affects.lua +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/check_lua/affects.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/check_lua/affects_drift.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/check_lua/blocking_io.lua +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/check_lua/blocking_io.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/check_lua/echo.lua +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/check_lua/fail.lua +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/check_lua/mode.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/check_lua/os.lua +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/check_lua/pathfmt/report_path.lua +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/check_lua/pathfmt/source.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/check_lua/pattern.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/check_lua/pattern_many_matches.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/check_lua/pattern_no_match.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/check_lua/success.lua +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/check_lua/success_and_failure.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/config/glob_target/config.toml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/config/glob_target/package.json +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/config/glob_target/plugins/blue/package.json +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/config/glob_target/plugins/green/package.json +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/config/glob_target/plugins/red/package.json +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/explain/a.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/explain/check.lua +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/general/block_selection.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/general/custom_file_extension.javascript +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/general/custom_file_extension.python +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/general/disable_enable.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/general/paths/invalid.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/general/paths/subdir/nested_invalid.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/general/paths/valid.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/general/severity.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/hidden/.github/workflows/ci.yml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/keep_sorted/orderings.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/keep_unique/basic_and_pattern.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/line_count/equality_and_greater_than.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/line_pattern/forbidden_text.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/line_pattern/hex_and_word_patterns.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/list/.hg/.gitkeep +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/list/a.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/list/b.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/positions/unicode_columns.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/same_as/custom_ext_source.javascript +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/same_as/custom_ext_target.javascript +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/same_as/package.json +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/same_as/paths/alpha/item.txt +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/same_as/paths/beta/item.txt +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/same_as/paths_and_block_source.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/same_as/paths_source.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/same_as/sibling.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/same_as/source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/same_as/split_table_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/same_as/split_table_target.toml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/same_as/symbol_mismatch_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/same_as/symbol_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/same_as/target.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/same_as/whole_file_mismatch_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/same_as/whole_file_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/same_as/whole_file_target.json +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/sarif/advisory.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/sarif/clean.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/sarif/sorted.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/sarif/unnamed.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/suppressions/commit_msg.txt +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/suppressions/commit_msg_gone_a.txt +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/suppressions/commit_msg_gone_b.txt +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/suppressions/commit_msg_lowercase_trailer.txt +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/suppressions/commit_msg_malformed.txt +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/suppressions/commit_msg_with_noise.txt +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/suppressions/dangling.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/suppressions/sorted.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/suppressions/symbol.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/suppressions/symbol_target.json +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/suppressions/two_rules.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/suppressions/unnamed.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/bzl_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/bzl_target.bzl +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/c_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/c_target.c +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/cpp_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/cpp_target.cpp +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/cs_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/cs_target.cs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/escapes_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/escapes_target.json +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/filter_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/filter_target.yaml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/go_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/go_target.go +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/h_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/h_target.h +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/hcl_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/hcl_target.hcl +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/java_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/java_target.java +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/js_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/js_target.js +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/json_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/json_target.json +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/jsonc_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/jsonc_target.jsonc +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/kt_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/kt_target.kt +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/kts_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/kts_target.kts +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/markdown_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/markdown_target.markdown +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/md_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/md_target.md +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/mdx_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/mdx_target.mdx +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/mixed_list_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/mixed_list_target.json +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/nomad_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/nomad_target.nomad +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/proto_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/proto_target.proto +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/py_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/py_target.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/rs_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/rs_target.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/swift_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/swift_target.swift +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/tf_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/tf_target.tf +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/tfvars_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/tfvars_target.tfvars +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/tofu_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/tofu_target.tofu +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/toml_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/toml_target.toml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/ts_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/ts_target.ts +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/tsx_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/tsx_target.tsx +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/yaml_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/yaml_target.yaml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/yml_source.rs +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/symbol_references/yml_target.yml +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/verbosity/affects/pair.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/verbosity/clean/counted.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/verbosity/clean/noop.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/verbosity/clean/notes.txt +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/verbosity/clean/sorted.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/verbosity/diff/two_blocks.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/verbosity/failing/unsorted.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/testdata/verbosity/mixed/both_kinds.py +0 -0
- {blockwatch_cli-0.16.5 → blockwatch_cli-0.16.7}/tests/verbosity.rs +0 -0
|
@@ -235,7 +235,7 @@ The main modules:
|
|
|
235
235
|
Some languages also have symbols. Such a language has a `SymbolsParser`, which its `parser()` passes to
|
|
236
236
|
`.with_symbols(...)`:
|
|
237
237
|
|
|
238
|
-
- JSON and
|
|
238
|
+
- JSON, YAML and XML walk their syntax trees themselves, and refuse a file with a syntax error.
|
|
239
239
|
- TOML finds its symbols with `toml_edit`. What a TOML key means depends on the order of the headers, not on how the
|
|
240
240
|
syntax tree is nested.
|
|
241
241
|
- Markdown finds its sections with the `markdown` crate, the same parser that finds its comments.
|
|
@@ -12,6 +12,41 @@ Releases up to and including v0.3.11 predate this file. Their notes live on the
|
|
|
12
12
|
|
|
13
13
|
## [Unreleased] - ReleaseDate
|
|
14
14
|
|
|
15
|
+
## [0.16.7] - 2026-11-04
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- Symbols in PHP files (`.php` and `.phtml`). `Invoice.php#/Invoice/STATUS_PAID` points at a class constant,
|
|
20
|
+
`#/Invoice/$perPage` at a property, and `version.php#/$wp_version` at a top-level variable. A
|
|
21
|
+
`define('NAME', value)` call is a symbol too, at `#/NAME`. The namespace is not part of a path. See
|
|
22
|
+
[PHP](docs/symbols.md#php).
|
|
23
|
+
- Symbols in shell scripts (`.sh`, `.bash`, `.bashrc`, `.bash_profile` and `.envrc`). `install.sh#/GO_VERSION`
|
|
24
|
+
points at the value of a variable, and `#/log` at a function. A name counts when it is set outside functions, loops
|
|
25
|
+
and subshells. zsh files have no symbols. See [Shell](docs/symbols.md#shell).
|
|
26
|
+
|
|
27
|
+
### Fixed
|
|
28
|
+
|
|
29
|
+
- A Python or Starlark string with an escape that Python rejects, such as `"\x4"` or `"\N"`, gave its text as the
|
|
30
|
+
value. Now a path to it stops the run, as a path to a string with a `\N{...}` escape does.
|
|
31
|
+
|
|
32
|
+
## [0.16.6] - 2026-11-04
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
- Symbols in XML files: `.xml`, the MSBuild files (`.csproj`, `.fsproj`, `.vbproj`, `.vcxproj`, `.props`,
|
|
37
|
+
`.targets`), `.xaml`, `.xsd`, `.xsl` and `.xslt`. `pom.xml#/project/version` points at the text of an element, and
|
|
38
|
+
`#/Project/@Sdk` at the value of an attribute. A filter picks one of several elements with one name:
|
|
39
|
+
`#/project/dependencies/~[artifactId=guava]/version`. See [XML](docs/symbols.md#xml).
|
|
40
|
+
- A filter picks one of several items that share a path, such as two `ingress` blocks in HCL:
|
|
41
|
+
`#/resource/aws_security_group/web/~[from_port=443]/to_port`. Before, the path was ambiguous. See
|
|
42
|
+
[Picking an item by a key's value](docs/symbols.md#picking-an-item-by-a-keys-value).
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- A filter over several items that share a path could read a key of another item, when only that item had the key.
|
|
47
|
+
- A filter could pick the wrong item when an item had a syntax error or a string that blockwatch can't decode. Now
|
|
48
|
+
such a path stops the run, as a path to that item does.
|
|
49
|
+
|
|
15
50
|
## [0.16.5] - 2026-11-03
|
|
16
51
|
|
|
17
52
|
### Added
|
|
@@ -235,7 +235,7 @@ The main modules:
|
|
|
235
235
|
Some languages also have symbols. Such a language has a `SymbolsParser`, which its `parser()` passes to
|
|
236
236
|
`.with_symbols(...)`:
|
|
237
237
|
|
|
238
|
-
- JSON and
|
|
238
|
+
- JSON, YAML and XML walk their syntax trees themselves, and refuse a file with a syntax error.
|
|
239
239
|
- TOML finds its symbols with `toml_edit`. What a TOML key means depends on the order of the headers, not on how the
|
|
240
240
|
syntax tree is nested.
|
|
241
241
|
- Markdown finds its sections with the `markdown` crate, the same parser that finds its comments.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: blockwatch-cli
|
|
3
|
-
Version: 0.16.
|
|
3
|
+
Version: 0.16.7
|
|
4
4
|
Summary: Language agnostic linter that keeps your code and documentation in sync and valid
|
|
5
5
|
Keywords: linter,sync,drift,comments,agents
|
|
6
6
|
Home-Page: https://github.com/mennanov/blockwatch
|
|
@@ -89,9 +89,10 @@ Two validators work across files:
|
|
|
89
89
|
- `same-as` fails when a block and its target hold different values. It needs no diff.
|
|
90
90
|
|
|
91
91
|
Both can point to a block, a whole file, a specific value in a file like `package.json#/version`, a section of a
|
|
92
|
-
Markdown file,
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
Markdown file, an element or attribute in an XML file such as `pom.xml` or a `.csproj`, a constant in a Go, C, C++,
|
|
93
|
+
Python, Rust, TypeScript, JavaScript, Java, C#, Kotlin, Swift or PHP file, a variable in a shell script, a field in a
|
|
94
|
+
Protocol Buffers file, or a value in a Terraform or other HCL file (see [Symbols](docs/symbols.md)). The other
|
|
95
|
+
validators check a single block on their own: the things you'd otherwise have to nitpick in code review.
|
|
95
96
|
|
|
96
97
|
<!-- <block name="available-validators"
|
|
97
98
|
same-as="src/validators/mod.rs:validator-registry, docs/validators/README.md:validators-index"
|
|
@@ -219,7 +220,7 @@ exclusions, and custom extension mappings.
|
|
|
219
220
|
|
|
220
221
|
```yaml
|
|
221
222
|
- repo: https://github.com/mennanov/blockwatch
|
|
222
|
-
rev: v0.16.
|
|
223
|
+
rev: v0.16.7 # Use latest release
|
|
223
224
|
hooks:
|
|
224
225
|
- id: blockwatch
|
|
225
226
|
```
|
|
@@ -19,7 +19,7 @@ To use [pre-commit](https://pre-commit.com), add the hook to `.pre-commit-config
|
|
|
19
19
|
|
|
20
20
|
```yaml
|
|
21
21
|
- repo: https://github.com/mennanov/blockwatch
|
|
22
|
-
rev: v0.16.
|
|
22
|
+
rev: v0.16.7 # Use latest release
|
|
23
23
|
hooks:
|
|
24
24
|
- id: blockwatch
|
|
25
25
|
```
|
|
@@ -59,7 +59,7 @@ The `blockwatch` hook runs before the commit message exists, so it cannot see a
|
|
|
59
59
|
|
|
60
60
|
```yaml
|
|
61
61
|
- repo: https://github.com/mennanov/blockwatch
|
|
62
|
-
rev: v0.16.
|
|
62
|
+
rev: v0.16.7 # Use latest release
|
|
63
63
|
hooks:
|
|
64
64
|
- id: blockwatch-commit-msg
|
|
65
65
|
```
|
|
@@ -557,15 +557,15 @@ Nothing else about the run changes: the same violations are found, and the exit
|
|
|
557
557
|
"tool": {
|
|
558
558
|
"driver": {
|
|
559
559
|
"name": "blockwatch",
|
|
560
|
-
"version": "0.16.
|
|
561
|
-
"semanticVersion": "0.16.
|
|
560
|
+
"version": "0.16.7",
|
|
561
|
+
"semanticVersion": "0.16.7",
|
|
562
562
|
"informationUri": "https://github.com/mennanov/blockwatch",
|
|
563
563
|
"rules": [
|
|
564
564
|
{
|
|
565
565
|
"id": "keep-sorted",
|
|
566
566
|
"name": "keep-sorted",
|
|
567
567
|
"shortDescription": { "text": "Requires the lines of a block to stay in order." },
|
|
568
|
-
"helpUri": "https://github.com/mennanov/blockwatch/blob/v0.16.
|
|
568
|
+
"helpUri": "https://github.com/mennanov/blockwatch/blob/v0.16.7/docs/validators/keep-sorted.md"
|
|
569
569
|
}
|
|
570
570
|
]
|
|
571
571
|
}
|
|
@@ -22,27 +22,30 @@ declares, instead of tags in a comment.
|
|
|
22
22
|
## Files with symbols
|
|
23
23
|
|
|
24
24
|
<!-- <block name="extensions-with-symbols" same-as="src/language_parsers/mod.rs:extensions-with-symbols"
|
|
25
|
-
same-as-pattern="`\.?(?P<value>[A-Za-z.]+)`"> -->
|
|
26
|
-
|
|
27
|
-
| Language | Files
|
|
28
|
-
|
|
29
|
-
| JSON | `.json`, `.jsonc`, `.webmanifest`
|
|
30
|
-
| TOML | `.toml`, `Pipfile`
|
|
31
|
-
| YAML | `.yaml`, `.yml`, `.cff`
|
|
32
|
-
| Markdown | `.md`, `.markdown`, `.mdx`
|
|
33
|
-
|
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
|
|
|
44
|
-
|
|
|
45
|
-
|
|
|
25
|
+
same-as-pattern="`\.?(?P<value>[A-Za-z._]+)`"> -->
|
|
26
|
+
|
|
27
|
+
| Language | Files | Paths |
|
|
28
|
+
|------------------|-------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
|
29
|
+
| JSON | `.json`, `.jsonc`, `.webmanifest` | [JSON](#json) |
|
|
30
|
+
| TOML | `.toml`, `Pipfile` | [TOML](#toml) |
|
|
31
|
+
| YAML | `.yaml`, `.yml`, `.cff` | [YAML](#yaml) |
|
|
32
|
+
| Markdown | `.md`, `.markdown`, `.mdx` | [Markdown](#markdown) |
|
|
33
|
+
| XML | `.xml`, `.csproj`, `.fsproj`, `.vbproj`, `.vcxproj`, `.props`, `.targets`, `.xaml`, `.xsd`, `.xsl`, `.xslt` | [XML](#xml) |
|
|
34
|
+
| Go | `.go` | [Go](#go) |
|
|
35
|
+
| C, C++ | `.c`, `.h`, `.cc`, `.cpp`, `.cxx`, `.hh`, `.hpp`, `.hxx` | [C and C++](#c-and-c) |
|
|
36
|
+
| Python | `.py`, `.pyi`, `.pyw` | [Python and Starlark](#python-and-starlark) |
|
|
37
|
+
| Starlark | `.bzl`, `.bazel`, `.bzlmod`, `.star`, `BUILD`, `BUCK`, `WORKSPACE`, `Tiltfile` | [Python and Starlark](#python-and-starlark) |
|
|
38
|
+
| Rust | `.rs` | [Rust](#rust) |
|
|
39
|
+
| TypeScript | `.ts`, `.mts`, `.cts`, `.d.ts`, `.tsx` | [TypeScript and JavaScript](#typescript-and-javascript) |
|
|
40
|
+
| JavaScript | `.js`, `.mjs`, `.cjs`, `.jsx` | [TypeScript and JavaScript](#typescript-and-javascript) |
|
|
41
|
+
| Java | `.java` | [Java](#java) |
|
|
42
|
+
| C# | `.cs` | [C#](#c) |
|
|
43
|
+
| Kotlin | `.kt`, `.kts` | [Kotlin](#kotlin) |
|
|
44
|
+
| Swift | `.swift` | [Swift](#swift) |
|
|
45
|
+
| Protocol Buffers | `.proto` | [Protocol Buffers](#protocol-buffers) |
|
|
46
|
+
| HCL (Terraform) | `.tf`, `.tofu`, `.tfvars`, `.hcl`, `.nomad` | [HCL](#hcl) |
|
|
47
|
+
| PHP | `.php`, `.phtml` | [PHP](#php) |
|
|
48
|
+
| Shell | `.sh`, `.bash`, `.bashrc`, `.bash_profile`, `.envrc` | [Shell](#shell) |
|
|
46
49
|
|
|
47
50
|
<!-- </block> -->
|
|
48
51
|
|
|
@@ -97,6 +100,12 @@ services:
|
|
|
97
100
|
- **A filter picks a map entry too.** In `{"a": {"name": "x"}}`, `#/~[name=x]` is `#/a`.
|
|
98
101
|
- **A path can hold several filters**, such as `#/groups/~[name=api]/services/~[name=web]/port`. A filter can come
|
|
99
102
|
first, in a file that is a list: `#/~[name=web]`.
|
|
103
|
+
- **When several items share a path, the rest of the path looks only inside the item the filter picked.** For
|
|
104
|
+
example, two `ingress` blocks in an HCL resource share a path.
|
|
105
|
+
`#/resource/aws_security_group/web/~[from_port=443]/to_port` is the `to_port` of the block whose `from_port` is
|
|
106
|
+
`443`.
|
|
107
|
+
- **A filter that reaches an unreadable path stops the run**, as that path does. An item blockwatch can't read, such
|
|
108
|
+
as one with a syntax error, also stops a filter that compares its key, because that item could match too.
|
|
100
109
|
- **The value starts after the first `=` and ends at the last `]`,** so it can hold both. The key can't hold `=`.
|
|
101
110
|
Inside a filter, escape the key and the value like any key: `/` as `~1`, `,` as `%2C`, and so on.
|
|
102
111
|
|
|
@@ -247,15 +256,78 @@ Clone the repository.
|
|
|
247
256
|
|
|
248
257
|
<!-- </block> -->
|
|
249
258
|
|
|
259
|
+
## XML
|
|
260
|
+
|
|
261
|
+
`.xml` files have symbols, and so do the MSBuild files (`.csproj`, `.fsproj`, `.vbproj`, `.vcxproj`, `.props`,
|
|
262
|
+
`.targets`), `.xaml`, `.xsd`, `.xsl` and `.xslt`.
|
|
263
|
+
|
|
264
|
+
<!-- <block name="xml-paths"> -->
|
|
265
|
+
|
|
266
|
+
Every element and every attribute is a symbol. A path is each element's name, from the root element down. An attribute
|
|
267
|
+
is `@` and its name, under its element:
|
|
268
|
+
|
|
269
|
+
```xml
|
|
270
|
+
<project xmlns="http://maven.apache.org/POM/4.0.0">
|
|
271
|
+
<version>1.4.2</version>
|
|
272
|
+
<dependencies>
|
|
273
|
+
<dependency>
|
|
274
|
+
<artifactId>junit</artifactId>
|
|
275
|
+
<version>5.10.0</version>
|
|
276
|
+
</dependency>
|
|
277
|
+
<dependency scope="test">
|
|
278
|
+
<artifactId>guava</artifactId>
|
|
279
|
+
<version>33.0.0-jre</version>
|
|
280
|
+
</dependency>
|
|
281
|
+
</dependencies>
|
|
282
|
+
<description>
|
|
283
|
+
Tools & helpers
|
|
284
|
+
</description>
|
|
285
|
+
</project>
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
| Path | Points at |
|
|
289
|
+
|------------------------------------------------------|---------------------------------|
|
|
290
|
+
| `#/project/version` | `1.4.2` |
|
|
291
|
+
| `#/project/dependencies` | the whole element |
|
|
292
|
+
| `#/project/dependencies/dependency/version` | a violation: two elements match |
|
|
293
|
+
| `#/project/dependencies/~[artifactId=guava]/version` | `33.0.0-jre` |
|
|
294
|
+
| `#/project/dependencies/~[artifactId=guava]/@scope` | `test` |
|
|
295
|
+
| `#/project/description` | `Tools & helpers` |
|
|
296
|
+
|
|
297
|
+
- **Elements with one name under one parent share a path**, such as the two `dependency` elements above. A path through
|
|
298
|
+
them is a violation, so pick one with a [filter](#picking-an-item-by-a-keys-value). Its key can be a child element,
|
|
299
|
+
such as `artifactId`, or an attribute. In a `.csproj` file, `#/Project/ItemGroup/~[@Include=Serilog]/@Version` is
|
|
300
|
+
the `Version` of the `PackageReference` whose `Include` is `Serilog`. A position, such as
|
|
301
|
+
`#/project/modules/module/1`, is not found.
|
|
302
|
+
- **A prefix is part of the name, as written.** Escape its `:` as `%3A`: `#/manifest/application/@android%3Aname`.
|
|
303
|
+
Namespaces play no part, and `xmlns` attributes are not symbols. Names compare as written, case included.
|
|
304
|
+
- **An element without child elements is its text.** Entities and character references are decoded, CDATA stays as
|
|
305
|
+
written, and comments are left out. The white space around the text is removed, but the line breaks and indents
|
|
306
|
+
inside it stay. `<a/>` and `<a></a>` are empty strings.
|
|
307
|
+
- **An element with child elements has no value.** It gives its whole text, tags included, even when it also holds
|
|
308
|
+
text.
|
|
309
|
+
- **An attribute is its decoded value.** Each tab and line break in it becomes a space, as XML requires. The white
|
|
310
|
+
space around it stays.
|
|
311
|
+
- **An entity that the DOCTYPE declares stops the run for its path**, because it can stand for any text, even
|
|
312
|
+
elements. So does a reference to a character that XML forbids, such as `�`.
|
|
313
|
+
- **The XML declaration, the DOCTYPE, comments and processing instructions are not symbols.**
|
|
314
|
+
- **An element covers its start tag, its content and its end tag.** An attribute covers `name="value"`. A comment
|
|
315
|
+
above an element is not part of it.
|
|
316
|
+
- **A syntax error anywhere stops the run**, and so does an empty file. A few valid files stop it too, because of the
|
|
317
|
+
parser: a DOCTYPE without white space before its `]`, as in `[<!ENTITY e "x">]`, and a processing instruction with
|
|
318
|
+
data, such as `<?pi x?>`, inside an element.
|
|
319
|
+
|
|
320
|
+
<!-- </block> -->
|
|
321
|
+
|
|
250
322
|
## Code files
|
|
251
323
|
|
|
252
324
|
<!-- <block name="code-files"> -->
|
|
253
325
|
|
|
254
326
|
In a code file, each top-level name is a symbol: a constant, a variable, a type, a function or a macro. Its path is
|
|
255
327
|
`#/NAME`.
|
|
256
|
-
With `const MaxPorts = 8` in `consts.go`, `consts.go#/MaxPorts` points at `8`. In Java, C#, Kotlin, Swift
|
|
257
|
-
Buffers, the members of a type are symbols too, under the type's name: `Config.java#/Config/MAX_PORTS`. In
|
|
258
|
-
block, attribute and object key is a symbol: `main.tf#/variable/region/default`.
|
|
328
|
+
With `const MaxPorts = 8` in `consts.go`, `consts.go#/MaxPorts` points at `8`. In Java, C#, Kotlin, Swift, Protocol
|
|
329
|
+
Buffers and PHP, the members of a type are symbols too, under the type's name: `Config.java#/Config/MAX_PORTS`. In
|
|
330
|
+
HCL, each block, attribute and object key is a symbol: `main.tf#/variable/region/default`.
|
|
259
331
|
|
|
260
332
|
- **A value is the initializer as written.** blockwatch never works it out: `20 * 1024 * 1024` stays as it is, and so
|
|
261
333
|
does `0x10`. Use `same-as-pattern` to take the part you need.
|
|
@@ -269,8 +341,8 @@ block, attribute and object key is a symbol: `main.tf#/variable/region/default`.
|
|
|
269
341
|
with a name from the text that the parser had to skip. Other names in the file still resolve. The message shows
|
|
270
342
|
where the error is.
|
|
271
343
|
- **A path to a string that blockwatch can't decode stops the run.** Other paths in the file still resolve.
|
|
272
|
-
- **Members are not symbols yet**, such as a method or a field, except in Java, C#, Kotlin, Swift, Protocol Buffers
|
|
273
|
-
and
|
|
344
|
+
- **Members are not symbols yet**, such as a method or a field, except in Java, C#, Kotlin, Swift, Protocol Buffers,
|
|
345
|
+
HCL and PHP.
|
|
274
346
|
|
|
275
347
|
<!-- </block> -->
|
|
276
348
|
|
|
@@ -396,7 +468,8 @@ def load(path):
|
|
|
396
468
|
value: `type Pair[T] = tuple[T, T]` is `#/Pair`.
|
|
397
469
|
- **Strings follow Python's escapes.** `"\xe9"` is `é`. An escape Python doesn't know, such as `\d`, stays as written.
|
|
398
470
|
A raw string is its text. An f-string without a field is its text, with `{{` as `{`. An f-string with a field and
|
|
399
|
-
bytes stay as written. A path to a string with a `\N{...}` escape stops the run
|
|
471
|
+
bytes stay as written. A path to a string with a `\N{...}` escape stops the run, and so does a path to a string
|
|
472
|
+
with an escape that Python rejects, such as `"\x4"` or `"\N"`.
|
|
400
473
|
- **Starlark files, such as `BUILD` and `.bzl`, follow the same rules.** A rule call, such as
|
|
401
474
|
`cc_library(name = "lib")`, is not a symbol.
|
|
402
475
|
- **Class members are not symbols yet.**
|
|
@@ -840,6 +913,7 @@ resource "aws_instance" "web" {
|
|
|
840
913
|
- **A path with only some of a block's labels points at nothing.** `#/resource/aws_instance` is no symbol.
|
|
841
914
|
- **A block written twice in one body makes its path a violation**, such as two `ingress` blocks in a resource. Two
|
|
842
915
|
`locals` blocks make `#/locals` a violation, but `#/locals/name` still resolves when only one of them sets `name`.
|
|
916
|
+
A filter picks one of the blocks: `#/resource/aws_security_group/web/~[from_port=443]/to_port`.
|
|
843
917
|
- **A key of an object is a segment when it is a name, a plain string, `true` or `false`**, such as `Team` or
|
|
844
918
|
`"cost center"`. A key written as a number or an expression, such as `3` or `(var.k)`, is not. The items of a list
|
|
845
919
|
are not symbols.
|
|
@@ -856,6 +930,159 @@ resource "aws_instance" "web" {
|
|
|
856
930
|
|
|
857
931
|
<!-- </block> -->
|
|
858
932
|
|
|
933
|
+
## PHP
|
|
934
|
+
|
|
935
|
+
<!-- <block name="php-paths"> -->
|
|
936
|
+
|
|
937
|
+
```php
|
|
938
|
+
<?php
|
|
939
|
+
namespace App\Billing;
|
|
940
|
+
|
|
941
|
+
const MAX_RETRIES = 3;
|
|
942
|
+
define('API_URL', 'https://api.example.com');
|
|
943
|
+
$version = '2.4.1';
|
|
944
|
+
|
|
945
|
+
if (!function_exists('money')) {
|
|
946
|
+
function money(int $cents): string { return number_format($cents / 100, 2); }
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
#[Entity]
|
|
950
|
+
final class Invoice extends Model
|
|
951
|
+
{
|
|
952
|
+
public const STATUS_PAID = 'paid';
|
|
953
|
+
protected static int $perPage = 25;
|
|
954
|
+
protected $table;
|
|
955
|
+
|
|
956
|
+
public function __construct(private readonly string $currency = "EUR") {}
|
|
957
|
+
|
|
958
|
+
public function table(): string { return $this->table; }
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
enum Status: string
|
|
962
|
+
{
|
|
963
|
+
case Open = 'open';
|
|
964
|
+
case Paid = 'paid';
|
|
965
|
+
}
|
|
966
|
+
```
|
|
967
|
+
|
|
968
|
+
| Path | Points at |
|
|
969
|
+
|-------------------------|-------------------------------------------------|
|
|
970
|
+
| `#/MAX_RETRIES` | `3` |
|
|
971
|
+
| `#/API_URL` | `https://api.example.com` |
|
|
972
|
+
| `#/$version` | `2.4.1` |
|
|
973
|
+
| `#/money` | the whole function |
|
|
974
|
+
| `#/Invoice` | the whole class, with `#[Entity]` |
|
|
975
|
+
| `#/Invoice/STATUS_PAID` | `paid` |
|
|
976
|
+
| `#/Invoice/$perPage` | `25` |
|
|
977
|
+
| `#/Invoice/$table` | `protected $table;`, as it has no default |
|
|
978
|
+
| `#/Invoice/$currency` | `EUR` |
|
|
979
|
+
| `#/Invoice/table` | the whole method |
|
|
980
|
+
| `#/Status/Paid` | `paid` |
|
|
981
|
+
| `#/App` | nothing, as a namespace is not a symbol |
|
|
982
|
+
|
|
983
|
+
- **Each top-level constant, variable, function, class, interface, trait and enum is a symbol, and so is each member
|
|
984
|
+
of a type**: a constant, a property, a method or an enum case. Both `const NAME = value;` and
|
|
985
|
+
`define('NAME', value);` define a constant.
|
|
986
|
+
- **The namespace is not part of a path.** Two namespaces in one file that define one name make that path a
|
|
987
|
+
violation.
|
|
988
|
+
- **A property and a variable keep their `$`**: `#/Invoice/$perPage`. So `$table` and `table()` have different paths.
|
|
989
|
+
- **A top-level variable is a symbol**: `$version = '2.4.1';` is `#/$version`. Only `$name = value` counts, not
|
|
990
|
+
`$items['key'] = 1` or `$object->name = 1`. In `$a = $b = 1`, only `$a` is a symbol, and its value is `$b = 1`.
|
|
991
|
+
- **A constructor parameter with a visibility is a property**: `private readonly string $currency` gives
|
|
992
|
+
`#/Invoice/$currency`. Its value is its default.
|
|
993
|
+
- **A definition in an `if`, `else`, `try`, `catch`, `finally`, `switch`, `declare` or `{ }` block counts**, such as a
|
|
994
|
+
function in `if (!function_exists('money'))`. One in a loop doesn't. A name defined in both branches of an `if` is a
|
|
995
|
+
violation.
|
|
996
|
+
- **Inside a function or a method, only a `define` is a symbol, and its path has no parent.** `define('BOOTED', 1);`
|
|
997
|
+
in the method `Kernel::boot()` gives `#/BOOTED`. Local variables, and functions and classes declared in a function,
|
|
998
|
+
are not symbols. Neither are closures, arrow functions and anonymous classes, or a `define` in them.
|
|
999
|
+
- **A `define` counts only as a whole statement whose name is plain text.** It covers the statement, with its `;`.
|
|
1000
|
+
`define($name, 1)`, `define('A\\', 1)`, `defined('X') or define('X', 1)` and a call with named arguments are not
|
|
1001
|
+
symbols.
|
|
1002
|
+
- **Names compare as written.** PHP ignores the case of class, function and method names, but `#/MONEY` doesn't find
|
|
1003
|
+
`function money`.
|
|
1004
|
+
- **Attributes are part of a definition. Doc comments are not.** In `const A = 1, B = 2;` and `public $a = 1, $b;`,
|
|
1005
|
+
each name covers only its own part.
|
|
1006
|
+
- **`namespace`, `use` imports, trait uses and `declare(strict_types=1)` are not symbols.** A trait's members sit under
|
|
1007
|
+
the trait, not under the classes that use it. The keys of an array, such as `return ['timezone' => 'UTC']` in a
|
|
1008
|
+
Laravel config file, are not symbols yet.
|
|
1009
|
+
- **Strings follow PHP's escapes.** `'it\'s'` is `it's`, and `"caf\u{e9}"` is `café`. A heredoc or a nowdoc loses the
|
|
1010
|
+
closing marker's indent on each line. A string with a variable, such as `"v$major"` or `"{$a}"`, stays as written.
|
|
1011
|
+
So does a string whose bytes are not UTF-8, such as `"\xFF"`, and a string that PHP rejects.
|
|
1012
|
+
- **In a template, the symbols come from the PHP code.** The HTML around it is skipped.
|
|
1013
|
+
- **A syntax error stops the run for the definition that holds it, and for each type around it.** The other
|
|
1014
|
+
definitions still resolve. The parser fails on a constructor parameter with `readonly` but no visibility, such as
|
|
1015
|
+
`__construct(readonly int $id)`, so a path into its class stops the run.
|
|
1016
|
+
|
|
1017
|
+
<!-- </block> -->
|
|
1018
|
+
|
|
1019
|
+
## Shell
|
|
1020
|
+
|
|
1021
|
+
<!-- <block name="shell-paths"> -->
|
|
1022
|
+
|
|
1023
|
+
```bash
|
|
1024
|
+
#!/usr/bin/env bash
|
|
1025
|
+
GO_VERSION=1.22.5
|
|
1026
|
+
export REGISTRY='ghcr.io/acme'
|
|
1027
|
+
readonly IMAGE="${REGISTRY}/app:${GO_VERSION}"
|
|
1028
|
+
PORT="${PORT:-8080}"
|
|
1029
|
+
TARGETS=(linux darwin)
|
|
1030
|
+
|
|
1031
|
+
if [[ "$(uname)" == Darwin ]]; then
|
|
1032
|
+
SED=gsed
|
|
1033
|
+
else
|
|
1034
|
+
SED=sed
|
|
1035
|
+
fi
|
|
1036
|
+
|
|
1037
|
+
log() { echo "$@" >&2; }
|
|
1038
|
+
|
|
1039
|
+
while [[ $# -gt 0 ]]; do
|
|
1040
|
+
case "$1" in
|
|
1041
|
+
--go) GO_VERSION="$2"; shift 2 ;;
|
|
1042
|
+
esac
|
|
1043
|
+
done
|
|
1044
|
+
```
|
|
1045
|
+
|
|
1046
|
+
| Path | Points at |
|
|
1047
|
+
|----------------|------------------------------------------------------|
|
|
1048
|
+
| `#/GO_VERSION` | `1.22.5`, as the copy in the loop doesn't count |
|
|
1049
|
+
| `#/REGISTRY` | `ghcr.io/acme` |
|
|
1050
|
+
| `#/IMAGE` | `"${REGISTRY}/app:${GO_VERSION}"`, as written |
|
|
1051
|
+
| `#/PORT` | `"${PORT:-8080}"`, as written |
|
|
1052
|
+
| `#/TARGETS` | `(linux darwin)`, as written |
|
|
1053
|
+
| `#/SED` | a violation, as both branches define it |
|
|
1054
|
+
| `#/log` | the whole function |
|
|
1055
|
+
|
|
1056
|
+
- **A variable or a function set outside functions, loops and subshells is a symbol.** The conditions and bodies of
|
|
1057
|
+
`if`, the items of `case`, `{ ... }` groups and the commands of `&&` and `||` count. So a name set in two branches
|
|
1058
|
+
is defined twice. Names set in `for`, `while` and `until` loops, in `( ... )`, in functions and in a statement that
|
|
1059
|
+
ends with `&` don't count, as bash sets them in a subshell or each time the loop runs.
|
|
1060
|
+
- **`export`, `readonly`, `declare` and `typeset` set a name too**, with or without flags such as `-r`. When the
|
|
1061
|
+
statement sets one name, the symbol covers the whole statement. In `export A=1 B=2`, `A` covers only `A=1`. The
|
|
1062
|
+
value is still the one written: bash stores `abc` for `declare -l X=ABC` and `3` for `declare -i X=1+2`, but the
|
|
1063
|
+
path gives `ABC` and `1+2`.
|
|
1064
|
+
- **These are not symbols:** `NAME+=value`, `A[0]=x`, `FOO=1 make` (it sets `FOO` only for `make`), `export NAME`
|
|
1065
|
+
without `=`, `local`, `: "${NAME:=default}"`, and names set by `read`, `for` or `getopts`.
|
|
1066
|
+
- **Strings follow bash's quoting.** `'a b'` is `a b`. In `"..."`, only `\$`, `` \` ``, `\"` and `\\` lose their
|
|
1067
|
+
backslash, and a `\` at the end of a line goes away with the line end. Outside quotes, every backslash goes:
|
|
1068
|
+
`a\ b` is `a b`. Parts written together are joined: `"a"'b'c` is `abc`. `X=` is the empty string.
|
|
1069
|
+
- **A value that bash expands stays as written**, such as `$HOME`, `$(cmd)`, `` `cmd` `` or `~/bin`. So does a word
|
|
1070
|
+
that starts with `~` after a quote, such as `"a"~/b`, and an array. Use `same-as-pattern` to take `8080` out of
|
|
1071
|
+
`"${PORT:-8080}"`.
|
|
1072
|
+
- **A path to a `$'...'` or `$"..."` string stops the run.**
|
|
1073
|
+
- **A function's name can hold `-`, `.` and `:`.** Write each `:` as `%3A`: `ns::helper` is `#/ns%3A%3Ahelper`.
|
|
1074
|
+
- **zsh files (`.zsh`, `.zshrc`) have no symbols.** The parser misreads much of zsh's syntax.
|
|
1075
|
+
- **After a syntax error, the parser often skips a large part of the file**, and every name in that part stops the
|
|
1076
|
+
run. It fails on `sed -e /^$/d`, on `${x/#$/y}`, and on a command whose name holds `::` after an assignment, such as
|
|
1077
|
+
`V=2 ns::log "x"`. A comment in backticks, such as `` find . `# skip vendor` -name x ``, is worse: the parser reads
|
|
1078
|
+
the rest of the file as the command's argument, so no name after it is found.
|
|
1079
|
+
- **A value outside quotes that goes on to the next line after a `\` is not found.** The parser reads `X=a\` and `b`
|
|
1080
|
+
on the next line as `X=a` set only for a command `b`. Bash sets `X=ab`. Put the value in quotes instead.
|
|
1081
|
+
- **A value that ends with a lone `$` takes in the next line.** In `Z=$` followed by `W=1`, `#/Z` gives `$`, the line
|
|
1082
|
+
end and `W=1`, as written, and `#/W` is not found. Bash sets `Z` to `$`. Write `Z='$'` instead.
|
|
1083
|
+
|
|
1084
|
+
<!-- </block> -->
|
|
1085
|
+
|
|
859
1086
|
---
|
|
860
1087
|
|
|
861
1088
|
[← Return to README](../README.md)
|
|
@@ -6,7 +6,7 @@ setup(
|
|
|
6
6
|
name='blockwatch-pre-commit-placeholder',
|
|
7
7
|
version='0.0.0',
|
|
8
8
|
# <block name="blockwatch-cli-version" same-as-pattern="blockwatch-cli==(?P<value>\d+\.\d+\.\d+)">
|
|
9
|
-
install_requires=['blockwatch-cli==0.16.
|
|
9
|
+
install_requires=['blockwatch-cli==0.16.7'],
|
|
10
10
|
# </block>
|
|
11
11
|
# Without it, setuptools takes the directories under src/ for Python packages.
|
|
12
12
|
packages=[],
|