blockwatch-cli 0.19.1__tar.gz → 0.19.2__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.19.1 → blockwatch_cli-0.19.2}/CHANGELOG.md +19 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/Cargo.lock +1 -1
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/Cargo.toml +1 -1
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/PKG-INFO +1 -1
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/README.md +1 -1
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/docs/ci.md +2 -2
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/docs/cli.md +13 -8
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/docs/validators/check-lua.md +2 -1
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/setup.py +1 -1
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/block_parser.rs +92 -87
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/blocks.rs +234 -86
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/config.rs +121 -49
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/explain.rs +1 -1
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/dockerfile.rs +1 -1
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/graphql.rs +1 -1
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/java.rs +1 -1
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/json.rs +6 -3
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/markdown.rs +22 -19
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/scala.rs +1 -1
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/lib.rs +14 -5
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/sarif.rs +4 -3
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/skill.md +1 -1
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/target_reference.rs +75 -30
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/validators/affects.rs +10 -8
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/validators/check_ai.rs +27 -15
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/validators/check_lua.rs +83 -22
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/validators/keep_sorted.rs +20 -17
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/validators/keep_unique.rs +8 -16
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/validators/line_count.rs +13 -12
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/validators/line_pattern.rs +11 -9
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/validators/mod.rs +110 -24
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/validators/same_as.rs +35 -23
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/virtual_blocks.rs +3 -3
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/config.rs +34 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/explain.rs +34 -6
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.agents/.claude-plugin/plugin.json +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.agents/skills/blockwatch/SKILL.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.claude-plugin/marketplace.json +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.github/FUNDING.yml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.github/dependabot.yml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.github/workflows/actions.lock +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.github/workflows/blockwatch.yml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.github/workflows/codeql.yml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.github/workflows/lockfile.yml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.github/workflows/markdownlint.yml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.github/workflows/pypi.yml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.github/workflows/release.yml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.github/workflows/rust.yml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.github/workflows/sign-archives.yml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.github/workflows/site.yml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.github/workflows/trusted-checks.yml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.github/zizmor.yml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.gitignore +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.markdownlint-cli2.yaml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.pre-commit-config.yaml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/.pre-commit-hooks.yaml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/AGENTS.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/CLAUDE.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/LICENSE +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/SECURITY.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/blockwatch.toml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/clippy.toml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/codecov.yml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/demo.gif +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/dist-workspace.toml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/docs/agents.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/docs/symbols.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/docs/validators/README.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/docs/validators/affects.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/docs/validators/check-ai.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/docs/validators/keep-sorted.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/docs/validators/keep-unique.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/docs/validators/line-count.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/docs/validators/line-pattern.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/docs/validators/same-as.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/pypi/pyproject.toml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/pyproject.toml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/release.toml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/scripts/check_language_count.lua +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/scripts/check_latest_gpt_nano_model.lua +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/cli.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/diff_parser.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/flags.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/fs.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/bash.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/c.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/c_sharp.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/cmake.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/cpp.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/css.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/dart.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/elixir.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/go.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/groovy.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/hcl.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/html.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/javascript.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/kotlin.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/lean.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/lua.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/makefile.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/mdx.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/mod.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/nix.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/ocaml.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/php.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/proto.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/python.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/ruby.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/rust.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/sql.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/starlark.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/swift.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/toml.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/tsx.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/typescript.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/xml.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_parsers/yaml.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/language_resolver.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/main.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/path_arguments.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/paths_glob.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/repo_path.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/report.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/scan.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/settings.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/symbol_path.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/symbols/code.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/symbols/mod.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/tag_parser.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/src/violation_address.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/affects.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/check_ai.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/check_lua.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/common/empty.toml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/common/mod.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/encoding.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/general.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/keep_sorted.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/keep_unique.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/line_count.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/line_pattern.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/list.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/path_arguments.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/repository_root.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/same_as.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/sarif.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/skill.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/suppressions.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/symbol_references.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/cross_file_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/cross_file_target.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/custom_ext_source.javascript +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/custom_ext_target.javascript +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/dangling.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/missing_symbol.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/more_added_than_deleted.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/multiline_tag_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/multiline_tag_target.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/nested_mapping_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/nested_mapping_target.yaml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/sibling.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/symbol_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/symbol_target.json +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/table_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/table_target.toml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/tag_and_content_source.ts +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/tag_and_content_target.ts +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/whole_file_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/affects/whole_file_target.json +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/check_ai/two_blocks.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/check_lua/affects.lua +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/check_lua/affects.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/check_lua/affects_drift.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/check_lua/blocking_io.lua +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/check_lua/blocking_io.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/check_lua/echo.lua +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/check_lua/fail.lua +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/check_lua/mode.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/check_lua/os.lua +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/check_lua/pathfmt/report_path.lua +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/check_lua/pathfmt/source.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/check_lua/pattern.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/check_lua/pattern_many_matches.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/check_lua/pattern_no_match.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/check_lua/success.lua +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/check_lua/success_and_failure.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/config/glob_target/config.toml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/config/glob_target/package.json +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/config/glob_target/plugins/blue/package.json +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/config/glob_target/plugins/green/package.json +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/config/glob_target/plugins/red/package.json +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/config/target_if_patterns/config.toml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/config/target_if_patterns/services/a/.env +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/config/target_if_patterns/services/b/.env +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/config/target_if_symbol_change/a.yml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/config/target_if_symbol_change/config.toml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/explain/a.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/explain/check.lua +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/general/block_selection.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/general/custom_file_extension.javascript +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/general/custom_file_extension.python +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/general/disable_enable.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/general/paths/invalid.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/general/paths/subdir/nested_invalid.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/general/paths/valid.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/general/severity.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/hidden/.github/workflows/ci.yml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/keep_sorted/orderings.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/keep_unique/basic_and_pattern.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/line_count/equality_and_greater_than.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/line_pattern/forbidden_text.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/line_pattern/hex_and_word_patterns.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/list/.hg/.gitkeep +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/list/a.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/list/b.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/positions/unicode_columns.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/same_as/custom_ext_source.javascript +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/same_as/custom_ext_target.javascript +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/same_as/package.json +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/same_as/paths/alpha/item.txt +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/same_as/paths/beta/item.txt +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/same_as/paths_and_block_source.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/same_as/paths_source.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/same_as/sibling.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/same_as/source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/same_as/split_table_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/same_as/split_table_target.toml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/same_as/symbol_mismatch_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/same_as/symbol_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/same_as/target.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/same_as/whole_file_mismatch_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/same_as/whole_file_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/same_as/whole_file_target.json +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/sarif/advisory.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/sarif/clean.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/sarif/sorted.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/sarif/unnamed.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/suppressions/commit_msg.txt +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/suppressions/commit_msg_gone_a.txt +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/suppressions/commit_msg_gone_b.txt +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/suppressions/commit_msg_lowercase_trailer.txt +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/suppressions/commit_msg_malformed.txt +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/suppressions/commit_msg_with_noise.txt +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/suppressions/dangling.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/suppressions/sorted.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/suppressions/symbol.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/suppressions/symbol_target.json +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/suppressions/two_rules.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/suppressions/unnamed.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/Dockerfile +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/Makefile +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/bzl_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/bzl_target.bzl +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/c_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/c_target.c +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/cpp_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/cpp_target.cpp +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/cs_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/cs_target.cs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/csproj_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/csproj_target.csproj +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/css_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/css_target.css +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/dart_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/dart_target.dart +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/dockerfile_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/escapes_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/escapes_target.json +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/filter_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/filter_target.yaml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/go_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/go_target.go +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/h_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/h_target.h +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/hcl_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/hcl_target.hcl +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/java_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/java_target.java +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/js_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/js_target.js +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/json_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/json_target.json +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/jsonc_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/jsonc_target.jsonc +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/kt_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/kt_target.kt +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/kts_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/kts_target.kts +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/makefile_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/markdown_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/markdown_target.markdown +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/md_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/md_target.md +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/mdx_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/mdx_target.mdx +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/mixed_list_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/mixed_list_target.json +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/nomad_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/nomad_target.nomad +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/php_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/php_target.php +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/phtml_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/phtml_target.phtml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/proto_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/proto_target.proto +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/py_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/py_target.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/rs_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/rs_target.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/sh_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/sh_target.sh +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/swift_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/swift_target.swift +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/tf_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/tf_target.tf +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/tfvars_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/tfvars_target.tfvars +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/tofu_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/tofu_target.tofu +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/toml_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/toml_target.toml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/ts_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/ts_target.ts +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/tsx_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/tsx_target.tsx +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/xml_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/xml_target.xml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/yaml_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/yaml_target.yaml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/yml_source.rs +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/symbol_references/yml_target.yml +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/verbosity/affects/pair.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/verbosity/clean/counted.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/verbosity/clean/noop.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/verbosity/clean/notes.txt +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/verbosity/clean/sorted.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/verbosity/diff/two_blocks.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/verbosity/failing/unsorted.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/testdata/verbosity/mixed/both_kinds.py +0 -0
- {blockwatch_cli-0.19.1 → blockwatch_cli-0.19.2}/tests/verbosity.rs +0 -0
|
@@ -12,6 +12,25 @@ 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.19.2] - 2026-11-14
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- In a `[[block]]` entry of `blockwatch.toml`, `affects` and `same-as` can now be TOML lists, such as
|
|
20
|
+
`same-as = ['README.md:version', 'docs/install.md']`. Each entry is one reference, so it can have a comma, as in
|
|
21
|
+
`'README.md#/Install, upgrade'`. A string with the references separated by commas still works. `blockwatch list`
|
|
22
|
+
and `blockwatch explain` show such a list as a JSON array, and `check-lua` scripts get it as an array of strings in
|
|
23
|
+
`ctx.attrs`.
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- `blockwatch explain` now lists a validator that the settings turn off under `disabled` when the block has only
|
|
28
|
+
`line-pattern-forbidden` or `same-as-paths`. Before, it listed `line-pattern` or `same-as` only for a block with an
|
|
29
|
+
attribute of that exact name.
|
|
30
|
+
- An unknown attribute in a `[[block]]` entry of `blockwatch.toml` now always fails with
|
|
31
|
+
``unrecognized attribute `keep-sortd` ``. With a value such as `false` or a list, the error used to be about the
|
|
32
|
+
value's type.
|
|
33
|
+
|
|
15
34
|
## [0.19.1] - 2026-11-13
|
|
16
35
|
|
|
17
36
|
### Added
|
|
@@ -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.19.
|
|
22
|
+
rev: v0.19.2 # 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.19.
|
|
62
|
+
rev: v0.19.2 # Use latest release
|
|
63
63
|
hooks:
|
|
64
64
|
- id: blockwatch-commit-msg
|
|
65
65
|
```
|
|
@@ -467,7 +467,10 @@ same-as-pattern = 'os\.environ\["(?P<value>[A-Z_]+)"\]'
|
|
|
467
467
|
[Glob targets](#glob-targets).
|
|
468
468
|
- Every other key is an attribute, with the same name and meaning as in a tag. An unknown attribute is an error.
|
|
469
469
|
- A value is a string. `true` stands for an attribute without a value, so `keep-unique = true` is `keep-unique`. An
|
|
470
|
-
integer counts as its digits, so `check-lua-timeout = 30` works.
|
|
470
|
+
integer counts as its digits, so `check-lua-timeout = 30` works. `affects` and `same-as` can also take a list, such
|
|
471
|
+
as `same-as = ['README.md:version', 'docs/install.md']`. Each entry is one reference, so it can have a comma, as in
|
|
472
|
+
`'README.md#/Install, upgrade'`. A string splits at every comma. An empty list is an error. Any other value is an
|
|
473
|
+
error.
|
|
471
474
|
- A target has at most one block. Put all its attributes in one entry. A second entry with the same `target` and the
|
|
472
475
|
same `target-pattern` is an error. So is a glob that matches a file another entry already wraps the same way.
|
|
473
476
|
|
|
@@ -680,15 +683,15 @@ Nothing else about the run changes: the same violations are found, and the exit
|
|
|
680
683
|
"tool": {
|
|
681
684
|
"driver": {
|
|
682
685
|
"name": "blockwatch",
|
|
683
|
-
"version": "0.19.
|
|
684
|
-
"semanticVersion": "0.19.
|
|
686
|
+
"version": "0.19.2",
|
|
687
|
+
"semanticVersion": "0.19.2",
|
|
685
688
|
"informationUri": "https://github.com/mennanov/blockwatch",
|
|
686
689
|
"rules": [
|
|
687
690
|
{
|
|
688
691
|
"id": "keep-sorted",
|
|
689
692
|
"name": "keep-sorted",
|
|
690
693
|
"shortDescription": { "text": "Requires the lines of a block to stay in order." },
|
|
691
|
-
"helpUri": "https://github.com/mennanov/blockwatch/blob/v0.19.
|
|
694
|
+
"helpUri": "https://github.com/mennanov/blockwatch/blob/v0.19.2/docs/validators/keep-sorted.md"
|
|
692
695
|
}
|
|
693
696
|
]
|
|
694
697
|
}
|
|
@@ -807,7 +810,8 @@ convention: the start is inclusive and the end is exclusive (`[start, end)`).
|
|
|
807
810
|
"package.json": [
|
|
808
811
|
{
|
|
809
812
|
"attributes": {
|
|
810
|
-
"line-pattern": "^\\d+\\.\\d+\\.\\d+$"
|
|
813
|
+
"line-pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
814
|
+
"same-as": ["README.md:version", "docs/install.md"]
|
|
811
815
|
},
|
|
812
816
|
"column": 3,
|
|
813
817
|
"config_line": 7,
|
|
@@ -821,9 +825,10 @@ convention: the start is inclusive and the end is exclusive (`[start, end)`).
|
|
|
821
825
|
|
|
822
826
|
[//]: # (</block>)
|
|
823
827
|
|
|
824
|
-
A block with no `name` attribute is reported as `(unnamed)`.
|
|
825
|
-
block
|
|
826
|
-
|
|
828
|
+
A block with no `name` attribute is reported as `(unnamed)`. Each attribute value is a string, except a list in a
|
|
829
|
+
[`[[block]]` entry](#blocks-in-the-config-file), which is an array of strings. Within a file, blocks appear in source
|
|
830
|
+
order and each block's attributes are sorted by name; the files themselves are not ordered, and two runs over an
|
|
831
|
+
unchanged tree may emit them differently. Sort by key downstream if you need to diff one run against another — or use
|
|
827
832
|
[`--verbosity full`](#full-reports), which does order its files.
|
|
828
833
|
|
|
829
834
|
## The `explain` Command
|
|
@@ -60,7 +60,8 @@ end
|
|
|
60
60
|
- `ctx.attrs` — the block's own attributes, keyed by attribute name, each value exactly as it was written in the
|
|
61
61
|
tag. A block tagged `<block check-lua="…" name="limits" severity="warning">` gives the script
|
|
62
62
|
`ctx.attrs["check-lua"]`, `ctx.attrs["name"]` and `ctx.attrs["severity"]`. Only blockwatch's own attributes can
|
|
63
|
-
appear here.
|
|
63
|
+
appear here. Each value is a string, except an `affects` or `same-as` list in a `[[block]]` entry of
|
|
64
|
+
`blockwatch.toml`. That one is a 1-based array of strings, one for each entry.
|
|
64
65
|
- `ctx.affects` — present only when the block also has an [`affects`](affects.md) attribute. A 1-based array with
|
|
65
66
|
one table per target, holding `file`, `name` and `content` (trimmed). `file` uses the same format as `ctx.file`.
|
|
66
67
|
Targets that don't resolve are left out.
|
|
@@ -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.19.
|
|
9
|
+
install_requires=['blockwatch-cli==0.19.2'],
|
|
10
10
|
# </block>
|
|
11
11
|
# Without it, setuptools takes the directories under src/ for Python packages.
|
|
12
12
|
packages=[],
|
|
@@ -362,10 +362,10 @@ impl BlockEnd {
|
|
|
362
362
|
|
|
363
363
|
#[cfg(test)]
|
|
364
364
|
mod tests {
|
|
365
|
-
use crate::blocks::{Block, BlockSeverity, Content, Declaration};
|
|
365
|
+
use crate::blocks::{Attributes, Block, BlockSeverity, Content, Declaration, TextAttribute};
|
|
366
366
|
use crate::language_parsers::LanguageParser;
|
|
367
|
+
use crate::test_utils::text_attributes;
|
|
367
368
|
use crate::{Position, language_parsers, test_utils};
|
|
368
|
-
use std::collections::HashMap;
|
|
369
369
|
|
|
370
370
|
fn create_parser() -> impl LanguageParser {
|
|
371
371
|
// Reuse existing real blocks parser.
|
|
@@ -398,7 +398,7 @@ mod tests {
|
|
|
398
398
|
assert_eq!(
|
|
399
399
|
blocks,
|
|
400
400
|
vec![Block {
|
|
401
|
-
attributes:
|
|
401
|
+
attributes: Attributes::default(),
|
|
402
402
|
start_tag_position_range: Position::new(1, 4)..Position::new(1, 11),
|
|
403
403
|
content: Content::source(
|
|
404
404
|
test_utils::substr_range(contents, " let say = \"hi\"; "),
|
|
@@ -419,7 +419,7 @@ mod tests {
|
|
|
419
419
|
assert_eq!(
|
|
420
420
|
blocks,
|
|
421
421
|
vec![Block {
|
|
422
|
-
attributes:
|
|
422
|
+
attributes: Attributes::default(),
|
|
423
423
|
start_tag_position_range: Position::new(1, 4)..Position::new(1, 11),
|
|
424
424
|
content: Content::source(
|
|
425
425
|
test_utils::substr_range(contents, "\nlet say = \"hi\";\n"),
|
|
@@ -446,7 +446,7 @@ println!("hello2");
|
|
|
446
446
|
blocks,
|
|
447
447
|
vec![
|
|
448
448
|
Block {
|
|
449
|
-
attributes:
|
|
449
|
+
attributes: Attributes::default(),
|
|
450
450
|
start_tag_position_range: Position::new(1, 4)..Position::new(1, 11),
|
|
451
451
|
content: Content::source(
|
|
452
452
|
test_utils::substr_range(contents, "\nprintln!(\"hello1\");\n"),
|
|
@@ -456,7 +456,7 @@ println!("hello2");
|
|
|
456
456
|
severity: BlockSeverity::Error,
|
|
457
457
|
},
|
|
458
458
|
Block {
|
|
459
|
-
attributes:
|
|
459
|
+
attributes: Attributes::default(),
|
|
460
460
|
start_tag_position_range: Position::new(4, 4)..Position::new(4, 11),
|
|
461
461
|
content: Content::source(
|
|
462
462
|
test_utils::substr_range(contents, "\nprintln!(\"hello2\");\n"),
|
|
@@ -479,7 +479,7 @@ println!("hello2");
|
|
|
479
479
|
blocks,
|
|
480
480
|
vec![
|
|
481
481
|
Block {
|
|
482
|
-
attributes:
|
|
482
|
+
attributes: Attributes::default(),
|
|
483
483
|
start_tag_position_range: Position::new(1, 4)..Position::new(1, 11),
|
|
484
484
|
content: Content::source(
|
|
485
485
|
test_utils::substr_range(contents, "println!(\"hello1\");"),
|
|
@@ -489,7 +489,7 @@ println!("hello2");
|
|
|
489
489
|
severity: BlockSeverity::Error,
|
|
490
490
|
},
|
|
491
491
|
Block {
|
|
492
|
-
attributes:
|
|
492
|
+
attributes: Attributes::default(),
|
|
493
493
|
start_tag_position_range: Position::new(1, 44)..Position::new(1, 51),
|
|
494
494
|
content: Content::source(
|
|
495
495
|
test_utils::substr_range(contents, "println!(\"hello2\");"),
|
|
@@ -512,7 +512,7 @@ println!("hello2");
|
|
|
512
512
|
blocks,
|
|
513
513
|
vec![
|
|
514
514
|
Block {
|
|
515
|
-
attributes:
|
|
515
|
+
attributes: Attributes::default(),
|
|
516
516
|
start_tag_position_range: Position::new(1, 4)..Position::new(1, 11),
|
|
517
517
|
content: Content::source(
|
|
518
518
|
test_utils::substr_range(contents, "\nprintln!(\"hello1\");\n"),
|
|
@@ -522,7 +522,7 @@ println!("hello2");
|
|
|
522
522
|
severity: BlockSeverity::Error,
|
|
523
523
|
},
|
|
524
524
|
Block {
|
|
525
|
-
attributes:
|
|
525
|
+
attributes: Attributes::default(),
|
|
526
526
|
start_tag_position_range: Position::new(3, 12)..Position::new(3, 19),
|
|
527
527
|
content: Content::source(
|
|
528
528
|
test_utils::substr_range(contents, "\nprintln!(\"hello2\");\n"),
|
|
@@ -572,21 +572,21 @@ println!("hello2");
|
|
|
572
572
|
blocks,
|
|
573
573
|
vec![
|
|
574
574
|
Block {
|
|
575
|
-
attributes:
|
|
575
|
+
attributes: text_attributes(&[("name", "foo")]),
|
|
576
576
|
start_tag_position_range: Position::new(2, 12)..Position::new(2, 30),
|
|
577
577
|
content: Content::source(30..620, Position::new(2, 30)..Position::new(25, 9),),
|
|
578
578
|
declaration: Declaration::Tags,
|
|
579
579
|
severity: BlockSeverity::Error,
|
|
580
580
|
},
|
|
581
581
|
Block {
|
|
582
|
-
attributes:
|
|
582
|
+
attributes: text_attributes(&[("name", "bar")]),
|
|
583
583
|
start_tag_position_range: Position::new(7, 16)..Position::new(7, 34),
|
|
584
584
|
content: Content::source(142..440, Position::new(7, 34)..Position::new(17, 13),),
|
|
585
585
|
declaration: Declaration::Tags,
|
|
586
586
|
severity: BlockSeverity::Error,
|
|
587
587
|
},
|
|
588
588
|
Block {
|
|
589
|
-
attributes:
|
|
589
|
+
attributes: text_attributes(&[("name", "bar-bar")]),
|
|
590
590
|
start_tag_position_range: Position::new(11, 20)..Position::new(11, 42),
|
|
591
591
|
content: Content::source(
|
|
592
592
|
281..415,
|
|
@@ -596,7 +596,7 @@ println!("hello2");
|
|
|
596
596
|
severity: BlockSeverity::Error,
|
|
597
597
|
},
|
|
598
598
|
Block {
|
|
599
|
-
attributes:
|
|
599
|
+
attributes: text_attributes(&[("name", "buzz")]),
|
|
600
600
|
start_tag_position_range: Position::new(19, 16)..Position::new(19, 35),
|
|
601
601
|
content: Content::source(
|
|
602
602
|
487..599,
|
|
@@ -606,7 +606,7 @@ println!("hello2");
|
|
|
606
606
|
severity: BlockSeverity::Error,
|
|
607
607
|
},
|
|
608
608
|
Block {
|
|
609
|
-
attributes:
|
|
609
|
+
attributes: text_attributes(&[("name", "fizz")]),
|
|
610
610
|
start_tag_position_range: Position::new(26, 12)..Position::new(26, 31),
|
|
611
611
|
content: Content::source(662..671, Position::new(26, 31)..Position::new(27, 9),),
|
|
612
612
|
declaration: Declaration::Tags,
|
|
@@ -635,10 +635,10 @@ println!("hello2");
|
|
|
635
635
|
"#;
|
|
636
636
|
let blocks = parse_all(&mut parser, contents)?;
|
|
637
637
|
assert_eq!(blocks.len(), 4);
|
|
638
|
-
assert_eq!(blocks[0].
|
|
639
|
-
assert_eq!(blocks[1].
|
|
640
|
-
assert_eq!(blocks[2].
|
|
641
|
-
assert_eq!(blocks[3].
|
|
638
|
+
assert_eq!(blocks[0].name(), Some("parent"));
|
|
639
|
+
assert_eq!(blocks[1].name(), Some("child1"));
|
|
640
|
+
assert_eq!(blocks[2].name(), Some("child2"));
|
|
641
|
+
assert_eq!(blocks[3].name(), Some("child3"));
|
|
642
642
|
Ok(())
|
|
643
643
|
}
|
|
644
644
|
|
|
@@ -652,7 +652,7 @@ println!("hello2");
|
|
|
652
652
|
assert_eq!(
|
|
653
653
|
blocks,
|
|
654
654
|
vec![Block {
|
|
655
|
-
attributes:
|
|
655
|
+
attributes: text_attributes(&[("name", "foo")]),
|
|
656
656
|
start_tag_position_range: Position::new(1, 4)..Position::new(1, 22),
|
|
657
657
|
content: Content::source(
|
|
658
658
|
test_utils::substr_range(contents, "\n let word = \"hello\";\n "),
|
|
@@ -684,7 +684,7 @@ println!("hello2");
|
|
|
684
684
|
assert_eq!(
|
|
685
685
|
blocks,
|
|
686
686
|
vec![Block {
|
|
687
|
-
attributes:
|
|
687
|
+
attributes: Attributes::default(),
|
|
688
688
|
start_tag_position_range: Position::new(1, 4)..Position::new(2, 2),
|
|
689
689
|
content: Content::source(
|
|
690
690
|
test_utils::substr_range(contents, " let say = \"hi\"; "),
|
|
@@ -706,10 +706,10 @@ println!("hello2");
|
|
|
706
706
|
assert_eq!(
|
|
707
707
|
blocks,
|
|
708
708
|
vec![Block {
|
|
709
|
-
attributes:
|
|
710
|
-
("name"
|
|
711
|
-
("keep-sorted"
|
|
712
|
-
("keep-unique"
|
|
709
|
+
attributes: text_attributes(&[
|
|
710
|
+
("name", "foo"),
|
|
711
|
+
("keep-sorted", ""),
|
|
712
|
+
("keep-unique", ""),
|
|
713
713
|
]),
|
|
714
714
|
start_tag_position_range: Position::new(1, 4)..Position::new(3, 16),
|
|
715
715
|
content: Content::source(
|
|
@@ -733,7 +733,7 @@ println!("hello2");
|
|
|
733
733
|
blocks,
|
|
734
734
|
vec![
|
|
735
735
|
Block {
|
|
736
|
-
attributes:
|
|
736
|
+
attributes: text_attributes(&[("name", "a")]),
|
|
737
737
|
start_tag_position_range: Position::new(1, 4)..Position::new(1, 20),
|
|
738
738
|
content: Content::source(
|
|
739
739
|
test_utils::substr_range(contents, "\nlet x = 1;\n"),
|
|
@@ -743,10 +743,7 @@ println!("hello2");
|
|
|
743
743
|
severity: BlockSeverity::Error,
|
|
744
744
|
},
|
|
745
745
|
Block {
|
|
746
|
-
attributes:
|
|
747
|
-
("name".to_string(), "b".to_string()),
|
|
748
|
-
("keep-sorted".to_string(), String::new()),
|
|
749
|
-
]),
|
|
746
|
+
attributes: text_attributes(&[("name", "b"), ("keep-sorted", ""),]),
|
|
750
747
|
start_tag_position_range: Position::new(3, 13)..Position::new(4, 16),
|
|
751
748
|
content: Content::source(
|
|
752
749
|
test_utils::substr_range(contents, "\nlet y = 2;\n"),
|
|
@@ -768,7 +765,7 @@ println!("hello2");
|
|
|
768
765
|
assert_eq!(
|
|
769
766
|
blocks,
|
|
770
767
|
vec![Block {
|
|
771
|
-
attributes:
|
|
768
|
+
attributes: Attributes::default(),
|
|
772
769
|
start_tag_position_range: Position::new(1, 4)..Position::new(1, 11),
|
|
773
770
|
content: Content::source(
|
|
774
771
|
test_utils::substr_range(contents, "\n// b\n// a\n"),
|
|
@@ -789,7 +786,7 @@ println!("hello2");
|
|
|
789
786
|
assert_eq!(
|
|
790
787
|
blocks,
|
|
791
788
|
vec![Block {
|
|
792
|
-
attributes:
|
|
789
|
+
attributes: Attributes::default(),
|
|
793
790
|
start_tag_position_range: Position::new(1, 4)..Position::new(1, 11),
|
|
794
791
|
content: Content::source(
|
|
795
792
|
test_utils::substr_range(contents, " let say = \"hi\"; "),
|
|
@@ -810,7 +807,7 @@ println!("hello2");
|
|
|
810
807
|
assert_eq!(
|
|
811
808
|
blocks,
|
|
812
809
|
vec![Block {
|
|
813
|
-
attributes:
|
|
810
|
+
attributes: Attributes::default(),
|
|
814
811
|
start_tag_position_range: Position::new(2, 1)..Position::new(2, 8),
|
|
815
812
|
content: Content::source(
|
|
816
813
|
test_utils::substr_range(contents, "println!(\"hello1\");"),
|
|
@@ -831,7 +828,7 @@ println!("hello2");
|
|
|
831
828
|
assert_eq!(
|
|
832
829
|
blocks,
|
|
833
830
|
vec![Block {
|
|
834
|
-
attributes:
|
|
831
|
+
attributes: Attributes::default(),
|
|
835
832
|
start_tag_position_range: Position::new(1, 4)..Position::new(1, 11),
|
|
836
833
|
content: Content::source(
|
|
837
834
|
test_utils::substr_range(contents, "println!(\"hello1\");"),
|
|
@@ -854,7 +851,7 @@ println!("hello2");
|
|
|
854
851
|
assert_eq!(
|
|
855
852
|
blocks,
|
|
856
853
|
vec![Block {
|
|
857
|
-
attributes:
|
|
854
|
+
attributes: Attributes::default(),
|
|
858
855
|
start_tag_position_range: Position::new(1, 9)..Position::new(1, 16),
|
|
859
856
|
content: Content::source(
|
|
860
857
|
test_utils::substr_range(contents, "\nlet say = \"hi\";\n"),
|
|
@@ -878,7 +875,7 @@ println!("hello2");
|
|
|
878
875
|
assert_eq!(
|
|
879
876
|
blocks,
|
|
880
877
|
vec![Block {
|
|
881
|
-
attributes:
|
|
878
|
+
attributes: Attributes::default(),
|
|
882
879
|
start_tag_position_range: Position::new(2, 9)..Position::new(2, 16),
|
|
883
880
|
content: Content::source(
|
|
884
881
|
test_utils::substr_range(contents, "\nlet say = \"hi\";\n"),
|
|
@@ -1078,7 +1075,7 @@ println!("hello2");
|
|
|
1078
1075
|
assert_eq!(
|
|
1079
1076
|
blocks
|
|
1080
1077
|
.iter()
|
|
1081
|
-
.map(|block| block.
|
|
1078
|
+
.map(|block| block.name().expect("a named block"))
|
|
1082
1079
|
.collect::<Vec<_>>(),
|
|
1083
1080
|
["a"]
|
|
1084
1081
|
);
|
|
@@ -1115,8 +1112,8 @@ println!("hello2");
|
|
|
1115
1112
|
.next()
|
|
1116
1113
|
.expect("a block")
|
|
1117
1114
|
.expect("no parse error")
|
|
1118
|
-
.
|
|
1119
|
-
"closed"
|
|
1115
|
+
.name(),
|
|
1116
|
+
Some("closed")
|
|
1120
1117
|
);
|
|
1121
1118
|
assert_eq!(
|
|
1122
1119
|
blocks
|
|
@@ -1175,10 +1172,7 @@ println!("hello2");
|
|
|
1175
1172
|
assert_eq!(blocks.len(), 1);
|
|
1176
1173
|
assert_eq!(
|
|
1177
1174
|
blocks[0].attributes,
|
|
1178
|
-
|
|
1179
|
-
("name".to_string(), "bar".to_string()),
|
|
1180
|
-
("check-ai".to_string(), "buzz".to_string())
|
|
1181
|
-
])
|
|
1175
|
+
text_attributes(&[("name", "bar"), ("check-ai", "buzz")])
|
|
1182
1176
|
);
|
|
1183
1177
|
Ok(())
|
|
1184
1178
|
}
|
|
@@ -1199,10 +1193,7 @@ println!("hello2");
|
|
|
1199
1193
|
assert_eq!(blocks.len(), 1);
|
|
1200
1194
|
assert_eq!(
|
|
1201
1195
|
blocks[0].attributes,
|
|
1202
|
-
|
|
1203
|
-
("name".to_string(), "bar".to_string()),
|
|
1204
|
-
("check-ai".to_string(), "buzz".to_string())
|
|
1205
|
-
])
|
|
1196
|
+
text_attributes(&[("name", "bar"), ("check-ai", "buzz")])
|
|
1206
1197
|
);
|
|
1207
1198
|
Ok(())
|
|
1208
1199
|
}
|
|
@@ -1215,8 +1206,11 @@ println!("hello2");
|
|
|
1215
1206
|
// </block>
|
|
1216
1207
|
"#;
|
|
1217
1208
|
let blocks = parse_all(&mut parser, contents)?;
|
|
1218
|
-
assert_eq!(blocks[0].
|
|
1219
|
-
assert_eq!(
|
|
1209
|
+
assert_eq!(blocks[0].name(), Some("red"));
|
|
1210
|
+
assert_eq!(
|
|
1211
|
+
blocks[0].attributes.text(TextAttribute::CheckAi),
|
|
1212
|
+
Some("sweet")
|
|
1213
|
+
);
|
|
1220
1214
|
Ok(())
|
|
1221
1215
|
}
|
|
1222
1216
|
|
|
@@ -1228,7 +1222,10 @@ println!("hello2");
|
|
|
1228
1222
|
// </block>
|
|
1229
1223
|
"#;
|
|
1230
1224
|
let blocks = parse_all(&mut parser, contents)?;
|
|
1231
|
-
assert_eq!(
|
|
1225
|
+
assert_eq!(
|
|
1226
|
+
blocks[0].attributes.text(TextAttribute::CheckAi),
|
|
1227
|
+
Some("He said \"Hello\"")
|
|
1228
|
+
);
|
|
1232
1229
|
Ok(())
|
|
1233
1230
|
}
|
|
1234
1231
|
|
|
@@ -1243,12 +1240,9 @@ println!("hello2");
|
|
|
1243
1240
|
let blocks = parse_all(&mut parser, contents)?;
|
|
1244
1241
|
assert_eq!(
|
|
1245
1242
|
blocks[0].attributes,
|
|
1246
|
-
|
|
1247
|
-
(
|
|
1248
|
-
|
|
1249
|
-
r#"\"(?P<value>[a-z]+)\""#.to_string()
|
|
1250
|
-
),
|
|
1251
|
-
("line-pattern".to_string(), r"^\'[a-z]+\'$".to_string())
|
|
1243
|
+
text_attributes(&[
|
|
1244
|
+
("keep-unique", r#"\"(?P<value>[a-z]+)\""#),
|
|
1245
|
+
("line-pattern", r"^\'[a-z]+\'$")
|
|
1252
1246
|
])
|
|
1253
1247
|
);
|
|
1254
1248
|
Ok(())
|
|
@@ -1265,10 +1259,7 @@ println!("hello2");
|
|
|
1265
1259
|
let blocks = parse_all(&mut parser, contents)?;
|
|
1266
1260
|
assert_eq!(
|
|
1267
1261
|
blocks[0].attributes,
|
|
1268
|
-
|
|
1269
|
-
("line-pattern".to_string(), r"^C:\\".to_string()),
|
|
1270
|
-
("keep-unique".to_string(), r"\w+\\".to_string())
|
|
1271
|
-
])
|
|
1262
|
+
text_attributes(&[("line-pattern", r"^C:\\"), ("keep-unique", r"\w+\\")])
|
|
1272
1263
|
);
|
|
1273
1264
|
Ok(())
|
|
1274
1265
|
}
|
|
@@ -1294,8 +1285,14 @@ println!("hello2");
|
|
|
1294
1285
|
// </block>
|
|
1295
1286
|
"#;
|
|
1296
1287
|
let blocks = parse_all(&mut parser, contents)?;
|
|
1297
|
-
assert_eq!(
|
|
1298
|
-
|
|
1288
|
+
assert_eq!(
|
|
1289
|
+
blocks[0].attributes.text(TextAttribute::KeepSorted),
|
|
1290
|
+
Some("")
|
|
1291
|
+
);
|
|
1292
|
+
assert_eq!(
|
|
1293
|
+
blocks[0].attributes.text(TextAttribute::KeepUnique),
|
|
1294
|
+
Some("")
|
|
1295
|
+
);
|
|
1299
1296
|
Ok(())
|
|
1300
1297
|
}
|
|
1301
1298
|
|
|
@@ -1310,11 +1307,7 @@ println!("hello2");
|
|
|
1310
1307
|
let blocks = parse_all(&mut parser, contents)?;
|
|
1311
1308
|
assert_eq!(
|
|
1312
1309
|
blocks[0].attributes,
|
|
1313
|
-
|
|
1314
|
-
("name".to_string(), "".to_string()),
|
|
1315
|
-
("check-ai".to_string(), "".to_string()),
|
|
1316
|
-
("keep-sorted".to_string(), "".to_string())
|
|
1317
|
-
])
|
|
1310
|
+
text_attributes(&[("name", ""), ("check-ai", ""), ("keep-sorted", "")])
|
|
1318
1311
|
);
|
|
1319
1312
|
Ok(())
|
|
1320
1313
|
}
|
|
@@ -1328,8 +1321,11 @@ println!("hello2");
|
|
|
1328
1321
|
// </block>
|
|
1329
1322
|
"#;
|
|
1330
1323
|
let blocks = parse_all(&mut parser, contents)?;
|
|
1331
|
-
assert_eq!(blocks[0].
|
|
1332
|
-
assert_eq!(
|
|
1324
|
+
assert_eq!(blocks[0].name(), Some("foo"));
|
|
1325
|
+
assert_eq!(
|
|
1326
|
+
blocks[0].attributes.text(TextAttribute::CheckAi),
|
|
1327
|
+
Some("bar")
|
|
1328
|
+
);
|
|
1333
1329
|
Ok(())
|
|
1334
1330
|
}
|
|
1335
1331
|
|
|
@@ -1343,10 +1339,19 @@ println!("hello2");
|
|
|
1343
1339
|
// </block>
|
|
1344
1340
|
"#;
|
|
1345
1341
|
let blocks = parse_all(&mut parser, contents)?;
|
|
1346
|
-
assert_eq!(blocks[0].
|
|
1347
|
-
assert_eq!(
|
|
1348
|
-
|
|
1349
|
-
|
|
1342
|
+
assert_eq!(blocks[0].name(), Some("red"));
|
|
1343
|
+
assert_eq!(
|
|
1344
|
+
blocks[0].attributes.text(TextAttribute::KeepSorted),
|
|
1345
|
+
Some("")
|
|
1346
|
+
);
|
|
1347
|
+
assert_eq!(
|
|
1348
|
+
blocks[0].attributes.text(TextAttribute::CheckAi),
|
|
1349
|
+
Some("center")
|
|
1350
|
+
);
|
|
1351
|
+
assert_eq!(
|
|
1352
|
+
blocks[0].attributes.text(TextAttribute::KeepUnique),
|
|
1353
|
+
Some("")
|
|
1354
|
+
);
|
|
1350
1355
|
Ok(())
|
|
1351
1356
|
}
|
|
1352
1357
|
|
|
@@ -1362,7 +1367,7 @@ println!("hello2");
|
|
|
1362
1367
|
|
|
1363
1368
|
// Duplicate attributes: last value wins (standard HTML/XML behavior)
|
|
1364
1369
|
assert_eq!(blocks.len(), 1);
|
|
1365
|
-
assert_eq!(blocks[0].
|
|
1370
|
+
assert_eq!(blocks[0].name(), Some("blue"));
|
|
1366
1371
|
Ok(())
|
|
1367
1372
|
}
|
|
1368
1373
|
|
|
@@ -1376,8 +1381,8 @@ println!("hello2");
|
|
|
1376
1381
|
let blocks = parse_all(&mut parser, contents)?;
|
|
1377
1382
|
|
|
1378
1383
|
assert_eq!(
|
|
1379
|
-
blocks[0].attributes
|
|
1380
|
-
"He said "Hello""
|
|
1384
|
+
blocks[0].attributes.text(TextAttribute::CheckAi),
|
|
1385
|
+
Some("He said "Hello"")
|
|
1381
1386
|
);
|
|
1382
1387
|
Ok(())
|
|
1383
1388
|
}
|
|
@@ -1390,7 +1395,10 @@ println!("hello2");
|
|
|
1390
1395
|
// </block>
|
|
1391
1396
|
"#;
|
|
1392
1397
|
let blocks = parse_all(&mut parser, contents)?;
|
|
1393
|
-
assert_eq!(
|
|
1398
|
+
assert_eq!(
|
|
1399
|
+
blocks[0].attributes.text(TextAttribute::KeepUnique),
|
|
1400
|
+
Some(r"(?P<value>\w+)")
|
|
1401
|
+
);
|
|
1394
1402
|
Ok(())
|
|
1395
1403
|
}
|
|
1396
1404
|
|
|
@@ -1403,8 +1411,11 @@ println!("hello2");
|
|
|
1403
1411
|
// </block>
|
|
1404
1412
|
"#;
|
|
1405
1413
|
let blocks = parse_all(&mut parser, contents)?;
|
|
1406
|
-
assert_eq!(blocks[0].
|
|
1407
|
-
assert_eq!(
|
|
1414
|
+
assert_eq!(blocks[0].name(), Some("🦀"));
|
|
1415
|
+
assert_eq!(
|
|
1416
|
+
blocks[0].attributes.text(TextAttribute::CheckAi),
|
|
1417
|
+
Some("Rust")
|
|
1418
|
+
);
|
|
1408
1419
|
Ok(())
|
|
1409
1420
|
}
|
|
1410
1421
|
|
|
@@ -1424,17 +1435,11 @@ println!("hello2");
|
|
|
1424
1435
|
assert_eq!(blocks.len(), 2);
|
|
1425
1436
|
assert_eq!(
|
|
1426
1437
|
blocks[0].attributes,
|
|
1427
|
-
|
|
1428
|
-
("name".to_string(), "outer".to_string()),
|
|
1429
|
-
("check-ai".to_string(), "bar".to_string()),
|
|
1430
|
-
])
|
|
1438
|
+
text_attributes(&[("name", "outer"), ("check-ai", "bar"),])
|
|
1431
1439
|
);
|
|
1432
1440
|
assert_eq!(
|
|
1433
1441
|
blocks[1].attributes,
|
|
1434
|
-
|
|
1435
|
-
("name".to_string(), "inner".to_string()),
|
|
1436
|
-
("keep-sorted".to_string(), "buzz".to_string())
|
|
1437
|
-
])
|
|
1442
|
+
text_attributes(&[("name", "inner"), ("keep-sorted", "buzz")])
|
|
1438
1443
|
);
|
|
1439
1444
|
Ok(())
|
|
1440
1445
|
}
|