Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[atddiff] Offer '--no-locations' option #382

Merged
merged 7 commits into from
Oct 26, 2023
Merged

Conversation

mjambon
Copy link
Collaborator

@mjambon mjambon commented Oct 26, 2023

--no-locations is aimed at producing more stable results that allow diffing successive atddiff reports to spot new findings and ignore old ones.

I marked this feature as experimental because it doesn't feel quite right to me. We'll be using it for identifying new findings by comparing the previous atddiff report with the current one in CI. Experience will tell us if it's good enough or if we need something different.

The JSON output format changed. Two records - full_finding and finding were merged into one, finding. Here's the atddiff output obtained via git:

$ git difftool -x atddiff 2.14.1... src/lib/Atddiff_output.atd

Viewing (1/1): 'atddiff/src/lib/Atddiff_output.atd'
Launch 'atddiff' [Y/n]? 
[0dcca10b] Forward incompatibility:
File "/tmp/git-blob-FAlVip/Atddiff_output.atd", line 90, characters 2-18:
Required field 'finding' disappeared.
The following types are affected:
  finding
  full_finding
  result

[3b6e126b] Backward incompatibility:
File "/tmp/git-blob-NEGUip/Atddiff_output.atd", line 82, characters 2-14:
Required field 'hash' is new.
The following types are affected:
  finding
  full_finding
  result

[00805a6d] Backward incompatibility:
File "/tmp/git-blob-NEGUip/Atddiff_output.atd", line 84, characters 2-22:
Required field 'direction' is new.
The following types are affected:
  finding
  full_finding
  result

[1675485b] Backward incompatibility:
File "/tmp/git-blob-NEGUip/Atddiff_output.atd", line 85, characters 2-28:
Required field 'kind' is new.
The following types are affected:
  finding
  full_finding
  result

[17a98b9a] Backward incompatibility:
File "/tmp/git-blob-NEGUip/Atddiff_output.atd", line 86, characters 2-31:
Required field 'location_old' is new.
The following types are affected:
  finding
  full_finding
  result

[100a1891] Backward incompatibility:
File "/tmp/git-blob-NEGUip/Atddiff_output.atd", line 87, characters 2-31:
Required field 'location_new' is new.
The following types are affected:
  finding
  full_finding
  result

[1aba7b00] Backward incompatibility:
File "/tmp/git-blob-NEGUip/Atddiff_output.atd", line 91, characters 2-21:
Required field 'description' is new.
The following types are affected:
  finding
  full_finding
  result

[2bcc902b] Backward incompatibility:
File "/tmp/git-blob-NEGUip/Atddiff_output.atd", line 93, characters 2-29:
Required field 'affected_types' is new.
The following types are affected:
  finding

I think it will be much easier to decipher once we show the snippets of code affected by the findings (feature request #380).

Closes #377

PR checklist

  • New code has tests to catch future regressions
  • Documentation is up-to-date
  • CHANGES.md is up-to-date

@mjambon mjambon merged commit ef660b7 into master Oct 26, 2023
2 checks passed
mjambon added a commit to mjambon/opam-repository that referenced this pull request Oct 27, 2023
CHANGES:

* atddiff: Breaking changes in the JSON output format of atddiff (ahrefs/atd#382)
* atddiff: Fix `atddiff --version` output (ahrefs/atd#379)
* atddiff: New experimental option `--no-locations` aimed at
           producing more stable results that allow diffing successive
           atddiff reports to spot new findings and ignore old ones (ahrefs/atd#377)
jchavarri added a commit to jchavarri/atd that referenced this pull request Nov 1, 2023
* master:
  Stop using the extension sphinx_rtd_theme This makes the two grammar tables slightly less pretty but still readable.
  Trying to build the docs with a version of Python that works on my machine
  Another attempt to fix the docs
  Uncomment config section that looks like what we need (ahrefs#389)
  Add sphinx_rtd_theme to requirements.txt (ahrefs#388)
  Fix path to docs (ahrefs#387)
  Add a readthedocs config file since they now require it. (ahrefs#386)
  Release 2.15.0
  [atddiff] Offer '--no-locations' option (ahrefs#382)
  Fix 'atddiff --version' (ahrefs#381)
nberth pushed a commit to nberth/opam-repository that referenced this pull request Jun 18, 2024
CHANGES:

* atddiff: Breaking changes in the JSON output format of atddiff (ahrefs/atd#382)
* atddiff: Fix `atddiff --version` output (ahrefs/atd#379)
* atddiff: New experimental option `--no-locations` aimed at
           producing more stable results that allow diffing successive
           atddiff reports to spot new findings and ignore old ones (ahrefs/atd#377)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

atddiff: provide output without line/column info for more stable results
1 participant