Skip to content

Commit

Permalink
Add notes
Browse files Browse the repository at this point in the history
  • Loading branch information
grihabor committed May 23, 2024
1 parent 8f5c274 commit 270b2c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 13 additions & 0 deletions docs/notes/2.22.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,19 @@ The two systems are expected to be more-or-less functionally identical. We plan

If you encounter such discrepancies, and you can't resolve them easily, please [reach out to us on Slack or file an issue](https://www.pantsbuild.org/community/getting-help).

### Fine grained diff with line numbers

This release introduces `Target.origin_sources_blocks` field that allows any
plugin to define dependencies on individual blocks of code rather that the
whole file. The `--changed-since` logic was updated to calculate fine grained
diff based on line numbers and compare the changed lines to
`origin_sources_blocks` to figure out which targets changed.

This feature is not used by any real plugin yet, but you can look at the [test
plugin](https://github.com/pantsbuild/pants/tree/2.22.x/testprojects/pants-plugins/src/python/python_constant/target_types.py)
for inspiration. To opt into the feature set the flag
`--enable-target-origin-sources-blocks`.

### Backends

#### NEW: SQL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@ def rule_runner():
*module_mapper.rules(),
*stripped_source_files.rules(),
*target_types_rules.rules(),
# python_register.rules(),
QueryRule(Addresses, (DependenciesRequest,)),
],
target_types=[
PythonSourceTarget,
PythonSourcesGeneratorTarget,
# *python_register.target_types(),
PythonConstantTarget,
PythonConstantTargetGenerator,
],
Expand Down

0 comments on commit 270b2c9

Please sign in to comment.