blockwatch-cli 0.16.8__tar.gz → 0.17.0__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.17.0/.github/FUNDING.yml +15 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/CHANGELOG.md +31 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/Cargo.lock +1 -1
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/Cargo.toml +1 -1
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/PKG-INFO +1 -1
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/README.md +7 -6
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/docs/ci.md +2 -2
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/docs/cli.md +3 -3
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/docs/symbols.md +74 -4
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/setup.py +1 -1
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/bash.rs +39 -17
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/c.rs +115 -36
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/c_sharp.rs +44 -32
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/cmake.rs +10 -11
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/cpp.rs +30 -2
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/css.rs +3 -15
- blockwatch_cli-0.17.0/src/language_parsers/dart.rs +1216 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/dockerfile.rs +7 -1
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/elixir.rs +7 -1
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/go.rs +19 -2
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/graphql.rs +7 -1
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/groovy.rs +17 -4
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/hcl.rs +25 -2
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/java.rs +25 -32
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/javascript.rs +13 -1
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/json.rs +27 -2
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/kotlin.rs +21 -6
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/lean.rs +82 -58
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/lua.rs +23 -18
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/makefile.rs +14 -4
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/markdown.rs +53 -24
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/mdx.rs +40 -17
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/mod.rs +120 -214
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/nix.rs +8 -3
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/ocaml.rs +10 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/php.rs +106 -76
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/proto.rs +55 -30
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/python.rs +16 -1
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/ruby.rs +13 -8
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/rust.rs +12 -23
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/scala.rs +29 -9
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/sql.rs +9 -3
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/starlark.rs +7 -1
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/swift.rs +31 -20
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/toml.rs +28 -16
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/tsx.rs +13 -1
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/typescript.rs +89 -56
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/xml.rs +41 -30
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/yaml.rs +45 -29
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/skill.md +21 -4
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/symbols/code.rs +48 -13
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/symbol_references.rs +7 -0
- blockwatch_cli-0.17.0/tests/testdata/symbol_references/dart_source.rs +3 -0
- blockwatch_cli-0.17.0/tests/testdata/symbol_references/dart_target.dart +3 -0
- blockwatch_cli-0.16.8/src/language_parsers/dart.rs +0 -79
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/.agents/.claude-plugin/plugin.json +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/.agents/skills/blockwatch/SKILL.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/.claude-plugin/marketplace.json +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/.github/dependabot.yml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/.github/workflows/blockwatch.yml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/.github/workflows/codeql.yml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/.github/workflows/markdownlint.yml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/.github/workflows/pypi.yml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/.github/workflows/release.yml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/.github/workflows/rust.yml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/.github/workflows/trusted-checks.yml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/.gitignore +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/.markdownlint-cli2.yaml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/.pre-commit-config.yaml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/.pre-commit-hooks.yaml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/AGENTS.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/CLAUDE.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/LICENSE +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/SECURITY.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/blockwatch.toml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/clippy.toml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/codecov.yml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/demo.gif +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/dist-workspace.toml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/docs/agents.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/docs/validators/README.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/docs/validators/affects.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/docs/validators/check-ai.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/docs/validators/check-lua.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/docs/validators/keep-sorted.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/docs/validators/keep-unique.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/docs/validators/line-count.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/docs/validators/line-pattern.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/docs/validators/same-as.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/pypi/pyproject.toml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/pyproject.toml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/release.toml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/scripts/check_language_count.lua +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/scripts/check_latest_gpt_nano_model.lua +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/block_parser.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/blocks.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/cli.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/config.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/diff_parser.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/explain.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/flags.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/fs.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/language_parsers/html.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/lib.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/main.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/path_arguments.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/paths_glob.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/repo_path.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/report.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/sarif.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/scan.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/settings.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/symbol_path.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/symbols/mod.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/tag_parser.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/target_reference.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/validators/affects.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/validators/check_ai.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/validators/check_lua.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/validators/keep_sorted.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/validators/keep_unique.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/validators/line_count.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/validators/line_pattern.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/validators/mod.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/validators/same_as.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/violation_address.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/src/virtual_blocks.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/affects.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/check_ai.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/check_lua.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/common/empty.toml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/common/mod.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/config.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/encoding.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/explain.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/general.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/keep_sorted.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/keep_unique.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/line_count.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/line_pattern.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/list.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/path_arguments.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/repository_root.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/same_as.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/sarif.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/skill.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/suppressions.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/cross_file_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/cross_file_target.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/custom_ext_source.javascript +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/custom_ext_target.javascript +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/dangling.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/missing_symbol.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/more_added_than_deleted.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/multiline_tag_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/multiline_tag_target.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/nested_mapping_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/nested_mapping_target.yaml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/sibling.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/symbol_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/symbol_target.json +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/table_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/table_target.toml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/tag_and_content_source.ts +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/tag_and_content_target.ts +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/whole_file_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/affects/whole_file_target.json +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/check_ai/two_blocks.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/check_lua/affects.lua +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/check_lua/affects.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/check_lua/affects_drift.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/check_lua/blocking_io.lua +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/check_lua/blocking_io.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/check_lua/echo.lua +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/check_lua/fail.lua +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/check_lua/mode.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/check_lua/os.lua +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/check_lua/pathfmt/report_path.lua +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/check_lua/pathfmt/source.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/check_lua/pattern.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/check_lua/pattern_many_matches.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/check_lua/pattern_no_match.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/check_lua/success.lua +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/check_lua/success_and_failure.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/config/glob_target/config.toml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/config/glob_target/package.json +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/config/glob_target/plugins/blue/package.json +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/config/glob_target/plugins/green/package.json +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/config/glob_target/plugins/red/package.json +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/explain/a.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/explain/check.lua +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/general/block_selection.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/general/custom_file_extension.javascript +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/general/custom_file_extension.python +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/general/disable_enable.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/general/paths/invalid.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/general/paths/subdir/nested_invalid.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/general/paths/valid.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/general/severity.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/hidden/.github/workflows/ci.yml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/keep_sorted/orderings.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/keep_unique/basic_and_pattern.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/line_count/equality_and_greater_than.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/line_pattern/forbidden_text.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/line_pattern/hex_and_word_patterns.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/list/.hg/.gitkeep +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/list/a.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/list/b.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/positions/unicode_columns.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/same_as/custom_ext_source.javascript +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/same_as/custom_ext_target.javascript +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/same_as/package.json +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/same_as/paths/alpha/item.txt +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/same_as/paths/beta/item.txt +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/same_as/paths_and_block_source.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/same_as/paths_source.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/same_as/sibling.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/same_as/source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/same_as/split_table_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/same_as/split_table_target.toml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/same_as/symbol_mismatch_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/same_as/symbol_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/same_as/target.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/same_as/whole_file_mismatch_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/same_as/whole_file_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/same_as/whole_file_target.json +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/sarif/advisory.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/sarif/clean.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/sarif/sorted.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/sarif/unnamed.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/suppressions/commit_msg.txt +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/suppressions/commit_msg_gone_a.txt +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/suppressions/commit_msg_gone_b.txt +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/suppressions/commit_msg_lowercase_trailer.txt +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/suppressions/commit_msg_malformed.txt +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/suppressions/commit_msg_with_noise.txt +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/suppressions/dangling.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/suppressions/sorted.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/suppressions/symbol.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/suppressions/symbol_target.json +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/suppressions/two_rules.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/suppressions/unnamed.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/Makefile +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/bzl_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/bzl_target.bzl +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/c_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/c_target.c +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/cpp_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/cpp_target.cpp +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/cs_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/cs_target.cs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/csproj_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/csproj_target.csproj +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/escapes_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/escapes_target.json +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/filter_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/filter_target.yaml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/go_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/go_target.go +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/h_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/h_target.h +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/hcl_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/hcl_target.hcl +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/java_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/java_target.java +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/js_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/js_target.js +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/json_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/json_target.json +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/jsonc_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/jsonc_target.jsonc +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/kt_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/kt_target.kt +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/kts_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/kts_target.kts +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/makefile_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/markdown_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/markdown_target.markdown +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/md_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/md_target.md +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/mdx_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/mdx_target.mdx +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/mixed_list_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/mixed_list_target.json +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/nomad_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/nomad_target.nomad +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/php_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/php_target.php +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/phtml_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/phtml_target.phtml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/proto_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/proto_target.proto +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/py_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/py_target.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/rs_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/rs_target.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/sh_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/sh_target.sh +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/swift_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/swift_target.swift +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/tf_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/tf_target.tf +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/tfvars_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/tfvars_target.tfvars +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/tofu_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/tofu_target.tofu +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/toml_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/toml_target.toml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/ts_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/ts_target.ts +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/tsx_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/tsx_target.tsx +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/xml_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/xml_target.xml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/yaml_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/yaml_target.yaml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/yml_source.rs +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/symbol_references/yml_target.yml +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/verbosity/affects/pair.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/verbosity/clean/counted.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/verbosity/clean/noop.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/verbosity/clean/notes.txt +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/verbosity/clean/sorted.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/verbosity/diff/two_blocks.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/verbosity/failing/unsorted.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/testdata/verbosity/mixed/both_kinds.py +0 -0
- {blockwatch_cli-0.16.8 → blockwatch_cli-0.17.0}/tests/verbosity.rs +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# These are supported funding model platforms
|
|
2
|
+
|
|
3
|
+
github: mennanov # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
|
4
|
+
patreon: # Replace with a single Patreon username
|
|
5
|
+
open_collective: # Replace with a single Open Collective username
|
|
6
|
+
ko_fi: # Replace with a single Ko-fi username
|
|
7
|
+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
|
8
|
+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
|
9
|
+
liberapay: # Replace with a single Liberapay username
|
|
10
|
+
issuehunt: # Replace with a single IssueHunt username
|
|
11
|
+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
|
|
12
|
+
polar: # Replace with a single Polar username
|
|
13
|
+
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
|
|
14
|
+
thanks_dev: # Replace with a single thanks.dev username
|
|
15
|
+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
|
@@ -12,6 +12,37 @@ 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.17.0] - 2026-11-06
|
|
16
|
+
|
|
17
|
+
### Added
|
|
18
|
+
|
|
19
|
+
- Symbols in Dart files (`.dart`). `config.dart#/Invoice/maxLines` points at a field of the class `Invoice`, and
|
|
20
|
+
`#/kApiVersion` at a variable at the top of the file. Each type is a symbol, and so is each field, method, getter,
|
|
21
|
+
setter, named constructor and enum value in it. A named extension's members sit under its name. See
|
|
22
|
+
[Dart](docs/symbols.md#dart).
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- In a tag that wraps over several comment lines, a longer marker such as `##`, `////` or `---` is now blanked whole,
|
|
27
|
+
in every language with `#`, `//` or `--` comments. So an attribute value that goes on to such a line loses the extra
|
|
28
|
+
characters. For example, in Python, a value that goes on to the line `##a` now holds `a` there, not `#a`. The same
|
|
29
|
+
goes for the stars at the start of a line in a `/* */` comment, such as ` ** `.
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
33
|
+
- A tag that wraps over several comment lines is no longer reported as malformed when each line starts with a longer
|
|
34
|
+
marker, such as `///`, `////`, `//!`, `##`, `---` or Python's `#:`. This works in every language with `//`, `#` or
|
|
35
|
+
`--` comments. In C and C++, it also works with Doxygen's `///<` and `//!<`. In Markdown, a tag can now wrap over
|
|
36
|
+
several `[//]: # (...)` lines too. In a `/* */` or OCaml `(* *)` comment, it can wrap over lines that start with
|
|
37
|
+
` ** `.
|
|
38
|
+
- In Bash and zsh files, a comment that starts with `#!` is no longer skipped, unless it is the shebang on the first
|
|
39
|
+
line. Before, a tag in such a comment was ignored.
|
|
40
|
+
- A string value with one of these line ends now reads as its language reads it:
|
|
41
|
+
- In JavaScript and TypeScript, a backslash before U+2028 or U+2029 joins the two lines. Before, the value kept the
|
|
42
|
+
separator.
|
|
43
|
+
- In a JavaScript or TypeScript template, a lone `\r` line end is `\n`. Before, the value kept the `\r`.
|
|
44
|
+
- In a C++ raw string, a `\r\n` line end is `\n`. Before, the value kept the `\r`.
|
|
45
|
+
|
|
15
46
|
## [0.16.8] - 2026-11-05
|
|
16
47
|
|
|
17
48
|
### Added
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: blockwatch-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.17.0
|
|
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
|
|
@@ -90,9 +90,10 @@ Two validators work across files:
|
|
|
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
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
|
|
94
|
-
field in a Protocol Buffers file, or a value in a Terraform or other HCL file (see
|
|
95
|
-
other validators check a single block on their own: the things you'd otherwise have
|
|
93
|
+
Python, Rust, TypeScript, JavaScript, Java, C#, Kotlin, Swift, PHP or Dart file, a variable in a shell script or a
|
|
94
|
+
Makefile, a field in a Protocol Buffers file, or a value in a Terraform or other HCL file (see
|
|
95
|
+
[Symbols](docs/symbols.md)). The other validators check a single block on their own: the things you'd otherwise have
|
|
96
|
+
to nitpick in code review.
|
|
96
97
|
|
|
97
98
|
<!-- <block name="available-validators"
|
|
98
99
|
same-as="src/validators/mod.rs:validator-registry, docs/validators/README.md:validators-index"
|
|
@@ -220,7 +221,7 @@ exclusions, and custom extension mappings.
|
|
|
220
221
|
|
|
221
222
|
```yaml
|
|
222
223
|
- repo: https://github.com/mennanov/blockwatch
|
|
223
|
-
rev: v0.
|
|
224
|
+
rev: v0.17.0 # Use latest release
|
|
224
225
|
hooks:
|
|
225
226
|
- id: blockwatch
|
|
226
227
|
```
|
|
@@ -260,7 +261,7 @@ For plain git hooks, local pre-commit setups, and sandboxing untrusted Lua scrip
|
|
|
260
261
|
- GraphQL (`.graphql`, `.graphqls`, `.gql`)
|
|
261
262
|
- Groovy (with `.gradle` and `Jenkinsfile` support)
|
|
262
263
|
- HCL (Terraform and OpenTofu: `.tf`, `.tfvars`, `.tofu`, `.hcl`; Nomad: `.nomad`)
|
|
263
|
-
- HTML (with `.xhtml` support)
|
|
264
|
+
- HTML (with `.xhtml` support; comments inside `<script>` and `<style>` are not read)
|
|
264
265
|
- JSON (`.json`, `.jsonc`, `.webmanifest`)
|
|
265
266
|
- Java
|
|
266
267
|
- JavaScript (with `.mjs` and `.cjs` support)
|
|
@@ -272,7 +273,7 @@ For plain git hooks, local pre-commit setups, and sandboxing untrusted Lua scrip
|
|
|
272
273
|
- Markdown
|
|
273
274
|
- Nix
|
|
274
275
|
- OCaml (`.ml`, `.mli`)
|
|
275
|
-
- PHP
|
|
276
|
+
- PHP (comments inside `<script>` and `<style>` are not read)
|
|
276
277
|
- Protocol Buffers (`.proto`)
|
|
277
278
|
- Python (with `.pyi` and `.pyw` support)
|
|
278
279
|
- Ruby (with `Gemfile`, `Rakefile`, `Podfile`, `Brewfile`, `Fastfile`, `Vagrantfile`, `.gemspec`, `.podspec`, `.rake`,
|
|
@@ -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.
|
|
22
|
+
rev: v0.17.0 # 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.
|
|
62
|
+
rev: v0.17.0 # 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.
|
|
561
|
-
"semanticVersion": "0.
|
|
560
|
+
"version": "0.17.0",
|
|
561
|
+
"semanticVersion": "0.17.0",
|
|
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.
|
|
568
|
+
"helpUri": "https://github.com/mennanov/blockwatch/blob/v0.17.0/docs/validators/keep-sorted.md"
|
|
569
569
|
}
|
|
570
570
|
]
|
|
571
571
|
}
|
|
@@ -47,6 +47,7 @@ declares, instead of tags in a comment.
|
|
|
47
47
|
| PHP | `.php`, `.phtml` | [PHP](#php) |
|
|
48
48
|
| Shell | `.sh`, `.bash`, `.bashrc`, `.bash_profile`, `.envrc` | [Shell](#shell) |
|
|
49
49
|
| Makefile | `Makefile`, `GNUmakefile`, `makefile`, `.mk`, `.mak` | [Makefile](#makefile) |
|
|
50
|
+
| Dart | `.dart` | [Dart](#dart) |
|
|
50
51
|
|
|
51
52
|
<!-- </block> -->
|
|
52
53
|
|
|
@@ -327,8 +328,8 @@ is `@` and its name, under its element:
|
|
|
327
328
|
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
|
|
328
329
|
`#/NAME`.
|
|
329
330
|
With `const MaxPorts = 8` in `consts.go`, `consts.go#/MaxPorts` points at `8`. In Java, C#, Kotlin, Swift, Protocol
|
|
330
|
-
Buffers and
|
|
331
|
-
HCL, each block, attribute and object key is a symbol: `main.tf#/variable/region/default`.
|
|
331
|
+
Buffers, PHP and Dart, the members of a type are symbols too, under the type's name: `Config.java#/Config/MAX_PORTS`.
|
|
332
|
+
In HCL, each block, attribute and object key is a symbol: `main.tf#/variable/region/default`.
|
|
332
333
|
|
|
333
334
|
- **A value is the initializer as written.** blockwatch never works it out: `20 * 1024 * 1024` stays as it is, and so
|
|
334
335
|
does `0x10`. Use `same-as-pattern` to take the part you need.
|
|
@@ -343,7 +344,7 @@ HCL, each block, attribute and object key is a symbol: `main.tf#/variable/region
|
|
|
343
344
|
where the error is.
|
|
344
345
|
- **A path to a string that blockwatch can't decode stops the run.** Other paths in the file still resolve.
|
|
345
346
|
- **Members are not symbols yet**, such as a method or a field, except in Java, C#, Kotlin, Swift, Protocol Buffers,
|
|
346
|
-
HCL and
|
|
347
|
+
HCL, PHP and Dart.
|
|
347
348
|
|
|
348
349
|
<!-- </block> -->
|
|
349
350
|
|
|
@@ -424,7 +425,7 @@ int helper(void) { return 0; }
|
|
|
424
425
|
- **Prototypes and `extern` variables are not symbols.** The definition is.
|
|
425
426
|
- **`template <...>` and `extern "C"` are part of the definition.** The contents of `extern "C" { ... }` are top-level.
|
|
426
427
|
- **Strings follow C's escapes, and strings written one after the other are joined.** A raw string, `R"(...)"`, is its
|
|
427
|
-
text
|
|
428
|
+
text, with each `\r\n` line end read as `\n`. `L`, `u` and `U` strings and character literals stay as written.
|
|
428
429
|
- **Namespaces, class members and names such as `Foo::bar` are not symbols yet.**
|
|
429
430
|
|
|
430
431
|
<!-- </block> -->
|
|
@@ -1202,6 +1203,75 @@ bin/app: $(SRC)
|
|
|
1202
1203
|
|
|
1203
1204
|
<!-- </block> -->
|
|
1204
1205
|
|
|
1206
|
+
## Dart
|
|
1207
|
+
|
|
1208
|
+
<!-- <block name="dart-paths"> -->
|
|
1209
|
+
|
|
1210
|
+
```dart
|
|
1211
|
+
const kApiVersion = '2.1.0';
|
|
1212
|
+
int retries = 3, timeout = 30;
|
|
1213
|
+
String get greeting => 'hi';
|
|
1214
|
+
|
|
1215
|
+
class Invoice {
|
|
1216
|
+
static const int maxLines = 20 * 1024;
|
|
1217
|
+
final int id;
|
|
1218
|
+
|
|
1219
|
+
Invoice(this.id);
|
|
1220
|
+
Invoice.draft() : id = 0;
|
|
1221
|
+
|
|
1222
|
+
int get total => _total;
|
|
1223
|
+
set total(int v) => _total = v;
|
|
1224
|
+
void send() {}
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
enum Mode { light, dark('d'); const Mode([this.code]); final String? code; }
|
|
1228
|
+
|
|
1229
|
+
extension StringX on String { bool get isBlank => trim().isEmpty; }
|
|
1230
|
+
```
|
|
1231
|
+
|
|
1232
|
+
| Path | Points at |
|
|
1233
|
+
|----------------------|---------------------------------------------------|
|
|
1234
|
+
| `#/kApiVersion` | `2.1.0` |
|
|
1235
|
+
| `#/retries` | `3` |
|
|
1236
|
+
| `#/greeting` | `hi` |
|
|
1237
|
+
| `#/Invoice` | the whole class |
|
|
1238
|
+
| `#/Invoice/maxLines` | `20 * 1024` |
|
|
1239
|
+
| `#/Invoice/id` | `final int id;`, as it has no value |
|
|
1240
|
+
| `#/Invoice/draft` | the whole constructor |
|
|
1241
|
+
| `#/Invoice/total` | a violation, as a getter and a setter share it |
|
|
1242
|
+
| `#/Invoice/send` | the whole method |
|
|
1243
|
+
| `#/Mode/dark` | `dark('d')`, as an enum value has no value |
|
|
1244
|
+
| `#/Mode/code` | `final String? code;` |
|
|
1245
|
+
| `#/StringX/isBlank` | `trim().isEmpty` |
|
|
1246
|
+
|
|
1247
|
+
- **Each top-level variable, function, getter, setter, type and type alias is a symbol, and so is each member of a
|
|
1248
|
+
type**: a field, a method, a getter, a setter, a named constructor or an enum value. Classes, mixins, enums,
|
|
1249
|
+
extensions and extension types are types. Dart has no nested types, so a path has at most two names:
|
|
1250
|
+
`#/Mode/dark`.
|
|
1251
|
+
- **A named constructor is a symbol**, as code calls it by its name: `Invoice.draft()` is `#/Invoice/draft`. The
|
|
1252
|
+
unnamed constructor is not, even when it is written `Invoice.new()`. The header of an extension type can declare a
|
|
1253
|
+
named constructor and a field: `extension type Meters.from(double value)` gives `#/Meters/from` and
|
|
1254
|
+
`#/Meters/value`.
|
|
1255
|
+
- **A named extension's members sit under its name**: `#/StringX/isBlank`. Two extensions of `String` in one file
|
|
1256
|
+
don't clash. An extension without a name has no symbols.
|
|
1257
|
+
- **A getter and a setter with one name are defined twice**, and so are a named constructor and a field with one
|
|
1258
|
+
name, such as `Button.disabled()` and `disabled`. Wrap the one you mean in a block instead.
|
|
1259
|
+
- **A variable's value is its initializer, and a getter's is the `v` of `=> v`.** A getter with a block body has no
|
|
1260
|
+
value, and neither has a function, a method or a constructor.
|
|
1261
|
+
- **Annotations are part of a definition. Doc comments are not.** In `int a = 1, b = 2;`, each name covers only its
|
|
1262
|
+
own part.
|
|
1263
|
+
- **The unnamed constructor, operators, `external` declarations, `library`, `import` and `part` directives, local
|
|
1264
|
+
declarations and closures are not symbols.** A file with `part of` has its own symbols.
|
|
1265
|
+
- **Strings follow Dart's escapes.** `'caf\u{e9}'` is `café`. Adjacent strings, such as `'a' "b"`, are joined. A raw
|
|
1266
|
+
string, such as `r'C:\new'`, has no escapes. A `'''` or `"""` string loses a first line that holds only spaces and
|
|
1267
|
+
tabs. Each line end in a string is a line feed, unless a backslash comes before it. A string with `$name` or
|
|
1268
|
+
`${...}` in any part stays as written. A path to a string that Dart rejects, such as `'\u{110000}'`, or to half of a
|
|
1269
|
+
character, such as `'\u{D800}'`, stops the run.
|
|
1270
|
+
- **A syntax error stops the run for the member that holds it, and for the type around it.** The other members still
|
|
1271
|
+
resolve.
|
|
1272
|
+
|
|
1273
|
+
<!-- </block> -->
|
|
1274
|
+
|
|
1205
1275
|
---
|
|
1206
1276
|
|
|
1207
1277
|
[← 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.
|
|
9
|
+
install_requires=['blockwatch-cli==0.17.0'],
|
|
10
10
|
# </block>
|
|
11
11
|
# Without it, setuptools takes the directories under src/ for Python packages.
|
|
12
12
|
packages=[],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
use crate::language_parsers::{
|
|
2
|
-
CommentsParser, LanguageParser, LanguageParserImpl, TreeSitterCommentsParser,
|
|
3
|
-
node_text, walk_tree,
|
|
2
|
+
CommentsParser, LanguageParser, LanguageParserImpl, TreeSitterCommentsParser,
|
|
3
|
+
blank_line_marker, comment_visitor, node_text, walk_tree,
|
|
4
4
|
};
|
|
5
5
|
use crate::symbols::ScalarValue;
|
|
6
6
|
use crate::symbols::code::{self, CodeLanguage, CodeSymbolsParser, Definition, Value};
|
|
@@ -177,18 +177,9 @@ fn declarations<'tree>(declaration: Node<'tree>, source: &str) -> Vec<Definition
|
|
|
177
177
|
.named_children(&mut cursor)
|
|
178
178
|
.filter(|child| !node_text(child, source).starts_with(['-', '+']))
|
|
179
179
|
.collect();
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
.
|
|
183
|
-
.filter(|name| name.kind() == "variable_assignment")
|
|
184
|
-
.filter_map(|name| {
|
|
185
|
-
let range = if is_only_name {
|
|
186
|
-
declaration.byte_range()
|
|
187
|
-
} else {
|
|
188
|
-
name.byte_range()
|
|
189
|
-
};
|
|
190
|
-
assignment(name, range)
|
|
191
|
-
})
|
|
180
|
+
code::part_ranges(declaration.byte_range(), names)
|
|
181
|
+
.filter(|(name, _)| name.kind() == "variable_assignment")
|
|
182
|
+
.filter_map(|(name, range)| assignment(name, range))
|
|
192
183
|
.collect()
|
|
193
184
|
}
|
|
194
185
|
|
|
@@ -201,11 +192,11 @@ fn comments_parser() -> anyhow::Result<impl CommentsParser> {
|
|
|
201
192
|
return None;
|
|
202
193
|
}
|
|
203
194
|
let comment = node_text(node, source);
|
|
204
|
-
|
|
205
|
-
|
|
195
|
+
// A shebang works only as the first line of a file. Any other `#!` line is a comment.
|
|
196
|
+
if node.start_byte() == 0 && comment.starts_with("#!") {
|
|
206
197
|
None
|
|
207
198
|
} else {
|
|
208
|
-
|
|
199
|
+
blank_line_marker(comment, &["#"])
|
|
209
200
|
}
|
|
210
201
|
}),
|
|
211
202
|
)?;
|
|
@@ -508,6 +499,8 @@ echo "Hello" # This is an inline comment
|
|
|
508
499
|
# several lines
|
|
509
500
|
|
|
510
501
|
VALUE=42 # Comment after code
|
|
502
|
+
## A section heading repeats the marker.
|
|
503
|
+
#! Only the first line of a file holds a shebang.
|
|
511
504
|
"#,
|
|
512
505
|
)
|
|
513
506
|
.collect();
|
|
@@ -545,9 +538,38 @@ VALUE=42 # Comment after code
|
|
|
545
538
|
source_range: 158..178,
|
|
546
539
|
comment_text: " Comment after code".to_string()
|
|
547
540
|
},
|
|
541
|
+
Comment {
|
|
542
|
+
position_range: Position::new(10, 1)..Position::new(10, 41),
|
|
543
|
+
source_range: 179..219,
|
|
544
|
+
comment_text: " A section heading repeats the marker.".to_string()
|
|
545
|
+
},
|
|
546
|
+
Comment {
|
|
547
|
+
position_range: Position::new(11, 1)..Position::new(11, 50),
|
|
548
|
+
source_range: 220..269,
|
|
549
|
+
comment_text: " ! Only the first line of a file holds a shebang.".to_string()
|
|
550
|
+
},
|
|
548
551
|
]
|
|
549
552
|
);
|
|
550
553
|
|
|
551
554
|
Ok(())
|
|
552
555
|
}
|
|
556
|
+
|
|
557
|
+
#[test]
|
|
558
|
+
fn comment_at_the_start_that_is_not_a_shebang_parse_returns_it() -> anyhow::Result<()> {
|
|
559
|
+
let mut comments_parser = comments_parser()?;
|
|
560
|
+
|
|
561
|
+
// Only a `#!` at the first byte of the file is a shebang.
|
|
562
|
+
for (source, expected) in [
|
|
563
|
+
("# Not a shebang.\n", " Not a shebang."),
|
|
564
|
+
("\n#! Not a shebang either.\n", " ! Not a shebang either."),
|
|
565
|
+
] {
|
|
566
|
+
let texts: Vec<String> = comments_parser
|
|
567
|
+
.parse(source)
|
|
568
|
+
.map(|comment| comment.comment_text)
|
|
569
|
+
.collect();
|
|
570
|
+
|
|
571
|
+
assert_eq!(texts, [expected], "{source:?}");
|
|
572
|
+
}
|
|
573
|
+
Ok(())
|
|
574
|
+
}
|
|
553
575
|
}
|
|
@@ -189,10 +189,7 @@ fn declaration_definitions(declaration: Node<'_>, start: usize) -> Vec<Definitio
|
|
|
189
189
|
let declarators: Vec<Node> = declaration
|
|
190
190
|
.children_by_field_name("declarator", &mut cursor)
|
|
191
191
|
.collect();
|
|
192
|
-
|
|
193
|
-
// other.
|
|
194
|
-
let alone = declarators.len() == 1;
|
|
195
|
-
for declarator in declarators {
|
|
192
|
+
for (declarator, range) in code::part_ranges(start..declaration.end_byte(), declarators) {
|
|
196
193
|
let Some((name, is_function)) = declared_name(declarator) else {
|
|
197
194
|
continue;
|
|
198
195
|
};
|
|
@@ -204,11 +201,6 @@ fn declaration_definitions(declaration: Node<'_>, start: usize) -> Vec<Definitio
|
|
|
204
201
|
if value.is_none() && (is_function || is_extern) {
|
|
205
202
|
continue;
|
|
206
203
|
}
|
|
207
|
-
let range = if alone {
|
|
208
|
-
start..declaration.end_byte()
|
|
209
|
-
} else {
|
|
210
|
-
declarator.byte_range()
|
|
211
|
-
};
|
|
212
204
|
definitions.push(Definition::new(Vec::new(), name, range, value));
|
|
213
205
|
}
|
|
214
206
|
definitions
|
|
@@ -368,6 +360,9 @@ fn macro_definition<'tree>(
|
|
|
368
360
|
}))
|
|
369
361
|
}
|
|
370
362
|
|
|
363
|
+
/// What a macro's body is parsed after, so that it parses as the value of a variable.
|
|
364
|
+
const MACRO_PREFIX: &str = "int x = ";
|
|
365
|
+
|
|
371
366
|
/// The value of `node`, a `#define` of `name` without parameters, in `source`: its body, read as
|
|
372
367
|
/// the value of a variable. `parser` parses the language of `source`.
|
|
373
368
|
///
|
|
@@ -387,20 +382,40 @@ fn macro_value<'tree>(
|
|
|
387
382
|
};
|
|
388
383
|
// The grammar keeps the body as one token. As the value of a variable, its strings,
|
|
389
384
|
// parentheses and comments parse as they do in code.
|
|
390
|
-
const PREFIX: &str = "int x = ";
|
|
391
385
|
let body_text = node_text(&body, source);
|
|
392
|
-
let text = format!("{
|
|
386
|
+
let text = format!("{MACRO_PREFIX}{body_text}\n;");
|
|
393
387
|
let tree = parser
|
|
394
388
|
.parse(&text, None)
|
|
395
389
|
.context("failed to parse syntax tree")?;
|
|
396
390
|
let root = tree.root_node();
|
|
397
|
-
let
|
|
398
|
-
//
|
|
391
|
+
let written = written_body(body_text, root);
|
|
392
|
+
// A body that is not one value, such as `static inline`, or that the grammar can't read,
|
|
393
|
+
// such as an unclosed string, is kept as written.
|
|
394
|
+
let initializer = root
|
|
395
|
+
.child(0)
|
|
396
|
+
.and_then(|declaration| declaration.child_by_field_name("declarator"))
|
|
397
|
+
.and_then(|declarator| declarator.child_by_field_name("value"))
|
|
398
|
+
.filter(|value| {
|
|
399
|
+
!root.has_error() && value.end_byte() == MACRO_PREFIX.len() + written.len()
|
|
400
|
+
});
|
|
401
|
+
Ok(match initializer {
|
|
402
|
+
Some(initializer) => initializer_value(initializer, &text, body, source),
|
|
403
|
+
None => Value::Read(ScalarValue {
|
|
404
|
+
text: written.to_string(),
|
|
405
|
+
byte_range: body.start_byte()..body.start_byte() + written.len(),
|
|
406
|
+
}),
|
|
407
|
+
})
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/// `body_text`, the body of a macro, without the `//` comment at its end and the backslashes that
|
|
411
|
+
/// continue it onto the next lines. `root` is the root of the body parsed after
|
|
412
|
+
/// [`MACRO_PREFIX`].
|
|
413
|
+
fn written_body<'a>(body_text: &'a str, root: Node) -> &'a str {
|
|
399
414
|
let mut written = body_text.trim_end();
|
|
400
415
|
if let Some(comment) = root
|
|
401
416
|
.descendant_for_byte_range(
|
|
402
|
-
|
|
403
|
-
|
|
417
|
+
MACRO_PREFIX.len() + written.len() - 1,
|
|
418
|
+
MACRO_PREFIX.len() + written.len(),
|
|
404
419
|
)
|
|
405
420
|
.filter(|last| last.kind() == "comment")
|
|
406
421
|
{
|
|
@@ -408,27 +423,26 @@ fn macro_value<'tree>(
|
|
|
408
423
|
clippy::string_slice,
|
|
409
424
|
reason = "tree-sitter nodes start on whole characters"
|
|
410
425
|
)]
|
|
411
|
-
let before = body_text[..comment.start_byte() -
|
|
426
|
+
let before = body_text[..comment.start_byte() - MACRO_PREFIX.len()].trim_end();
|
|
412
427
|
written = before;
|
|
413
428
|
}
|
|
414
429
|
// A backslash can continue the body onto a line that holds only a comment.
|
|
415
430
|
while let Some(continued) = written.strip_suffix('\\') {
|
|
416
431
|
written = continued.trim_end();
|
|
417
432
|
}
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
Ok(match code::node_value(initializer, &text, &decode_string) {
|
|
433
|
+
written
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/// The value of `initializer`, the value in `text`, which is the macro body `body` parsed after
|
|
437
|
+
/// [`MACRO_PREFIX`]. Its positions are where the body is in `source`.
|
|
438
|
+
fn initializer_value<'tree>(
|
|
439
|
+
initializer: Node,
|
|
440
|
+
text: &str,
|
|
441
|
+
body: Node<'tree>,
|
|
442
|
+
source: &str,
|
|
443
|
+
) -> Value<'tree> {
|
|
444
|
+
let in_file = |at: usize| body.start_byte() + at - MACRO_PREFIX.len();
|
|
445
|
+
match code::node_value(initializer, text, &decode_string) {
|
|
432
446
|
Ok(value) => Value::Read(ScalarValue {
|
|
433
447
|
text: value.text,
|
|
434
448
|
byte_range: in_file(value.byte_range.start)..in_file(value.byte_range.end),
|
|
@@ -439,7 +453,7 @@ fn macro_value<'tree>(
|
|
|
439
453
|
let at = in_file(string.start_byte());
|
|
440
454
|
Value::Undecodable(Position::new(line, character_column_at(source, at)), error)
|
|
441
455
|
}
|
|
442
|
-
}
|
|
456
|
+
}
|
|
443
457
|
}
|
|
444
458
|
|
|
445
459
|
/// Decodes a C or C++ string literal, or several written one after the other, which C joins.
|
|
@@ -457,8 +471,9 @@ fn decode_string(node: &Node, source: &str) -> anyhow::Result<Option<String>> {
|
|
|
457
471
|
_ => Ok(None),
|
|
458
472
|
},
|
|
459
473
|
"raw_string_literal" => match node.child(0).map(|open| open.kind()) {
|
|
474
|
+
// C++ reads a `\r\n` line end as `\n`, in a raw string too. A lone `\r` stays.
|
|
460
475
|
Some("R\"" | "u8R\"") => Ok(code::child(*node, "raw_string_content")
|
|
461
|
-
.map(|content| node_text(&content, source).
|
|
476
|
+
.map(|content| node_text(&content, source).replace("\r\n", "\n"))),
|
|
462
477
|
_ => Ok(None),
|
|
463
478
|
},
|
|
464
479
|
_ => Ok(None),
|
|
@@ -513,7 +528,11 @@ fn push_escape(escape: &str, bytes: &mut Vec<u8>) -> anyhow::Result<()> {
|
|
|
513
528
|
|
|
514
529
|
fn comments_parser() -> anyhow::Result<impl CommentsParser> {
|
|
515
530
|
let cpp_language = tree_sitter_c::LANGUAGE.into();
|
|
516
|
-
let parser = language_parsers::c_style_comments_parser(
|
|
531
|
+
let parser = language_parsers::c_style_comments_parser(
|
|
532
|
+
&cpp_language,
|
|
533
|
+
&["comment"],
|
|
534
|
+
language_parsers::DOXYGEN_MARKERS,
|
|
535
|
+
)?;
|
|
517
536
|
Ok(parser)
|
|
518
537
|
}
|
|
519
538
|
|
|
@@ -830,14 +849,19 @@ char C = 'c';
|
|
|
830
849
|
|
|
831
850
|
#[test]
|
|
832
851
|
fn raw_strings_parse_symbols_returns_the_text_of_narrow_ones() -> anyhow::Result<()> {
|
|
833
|
-
|
|
852
|
+
// A Rust raw string can't hold a carriage return, so the lines with `\r` are escaped.
|
|
853
|
+
let source = concat!(
|
|
854
|
+
r#"const char *Raw = R"d(a"b)d";
|
|
834
855
|
const char *Utf8Raw = u8R"(é)";
|
|
835
856
|
const char *WideRaw = LR"(w)";
|
|
836
857
|
const char *Lines = R"(a
|
|
837
858
|
b)";
|
|
838
859
|
const char *Empty = R"()";
|
|
839
860
|
#define MACRO_RAW R"(x")"
|
|
840
|
-
"
|
|
861
|
+
"#,
|
|
862
|
+
"const char *CrlfLines = R\"(a\r\nb)\";\n",
|
|
863
|
+
"const char *CrLines = R\"(a\rb)\";\n"
|
|
864
|
+
);
|
|
841
865
|
|
|
842
866
|
assert_eq!(
|
|
843
867
|
values(&cpp(source)?, source),
|
|
@@ -848,6 +872,9 @@ const char *Empty = R"()";
|
|
|
848
872
|
value("/Lines", "a\nb"),
|
|
849
873
|
value("/Empty", ""),
|
|
850
874
|
value("/MACRO_RAW", r#"x""#),
|
|
875
|
+
// C++ reads a `\r\n` line end as `\n`, in a raw string too. A lone `\r` stays.
|
|
876
|
+
value("/CrlfLines", "a\nb"),
|
|
877
|
+
value("/CrLines", "a\rb"),
|
|
851
878
|
]
|
|
852
879
|
);
|
|
853
880
|
Ok(())
|
|
@@ -1132,6 +1159,16 @@ mod tests {
|
|
|
1132
1159
|
return 0;
|
|
1133
1160
|
}
|
|
1134
1161
|
/// Triple slash comment.
|
|
1162
|
+
//! Doxygen reads this marker as a doc comment, in the Qt style.
|
|
1163
|
+
//// A banner line repeats the marker.
|
|
1164
|
+
int a; ///< Doxygen documents the member before this comment.
|
|
1165
|
+
int b; //!< Doxygen documents the member before this comment, in the Qt style.
|
|
1166
|
+
//!Doxygen reads this marker with no space after it too.
|
|
1167
|
+
int c; ///<
|
|
1168
|
+
//<block name="x"> A tag right after the marker keeps its first character.
|
|
1169
|
+
/**
|
|
1170
|
+
** A comment that starts each line with two stars.
|
|
1171
|
+
**/
|
|
1135
1172
|
"#,
|
|
1136
1173
|
)
|
|
1137
1174
|
.collect();
|
|
@@ -1164,7 +1201,49 @@ mod tests {
|
|
|
1164
1201
|
Comment {
|
|
1165
1202
|
position_range: Position::new(20, 1)..Position::new(20, 26),
|
|
1166
1203
|
source_range: 468..493,
|
|
1167
|
-
comment_text: "
|
|
1204
|
+
comment_text: " Triple slash comment.".to_string()
|
|
1205
|
+
},
|
|
1206
|
+
Comment {
|
|
1207
|
+
position_range: Position::new(21, 1)..Position::new(21, 65),
|
|
1208
|
+
source_range: 494..558,
|
|
1209
|
+
comment_text: " Doxygen reads this marker as a doc comment, in the Qt style.".to_string()
|
|
1210
|
+
},
|
|
1211
|
+
Comment {
|
|
1212
|
+
position_range: Position::new(22, 1)..Position::new(22, 39),
|
|
1213
|
+
source_range: 559..597,
|
|
1214
|
+
comment_text: " A banner line repeats the marker.".to_string()
|
|
1215
|
+
},
|
|
1216
|
+
Comment {
|
|
1217
|
+
position_range: Position::new(23, 8)..Position::new(23, 62),
|
|
1218
|
+
source_range: 605..659,
|
|
1219
|
+
comment_text: " Doxygen documents the member before this comment.".to_string()
|
|
1220
|
+
},
|
|
1221
|
+
Comment {
|
|
1222
|
+
position_range: Position::new(24, 8)..Position::new(24, 79),
|
|
1223
|
+
source_range: 667..738,
|
|
1224
|
+
comment_text: " Doxygen documents the member before this comment, in the Qt style.".to_string()
|
|
1225
|
+
},
|
|
1226
|
+
Comment {
|
|
1227
|
+
position_range: Position::new(25, 1)..Position::new(25, 57),
|
|
1228
|
+
source_range: 739..795,
|
|
1229
|
+
comment_text: " Doxygen reads this marker with no space after it too.".to_string()
|
|
1230
|
+
},
|
|
1231
|
+
Comment {
|
|
1232
|
+
position_range: Position::new(26, 8)..Position::new(26, 12),
|
|
1233
|
+
source_range: 803..807,
|
|
1234
|
+
comment_text: " ".to_string()
|
|
1235
|
+
},
|
|
1236
|
+
Comment {
|
|
1237
|
+
position_range: Position::new(27, 1)..Position::new(27, 75),
|
|
1238
|
+
source_range: 808..882,
|
|
1239
|
+
comment_text: r#" <block name="x"> A tag right after the marker keeps its first character."#
|
|
1240
|
+
.to_string()
|
|
1241
|
+
},
|
|
1242
|
+
Comment {
|
|
1243
|
+
position_range: Position::new(28, 1)..Position::new(30, 5),
|
|
1244
|
+
source_range: 883..943,
|
|
1245
|
+
comment_text: " \n A comment that starts each line with two stars.\n "
|
|
1246
|
+
.to_string()
|
|
1168
1247
|
},
|
|
1169
1248
|
]
|
|
1170
1249
|
);
|