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

Support logging verification results in JSON #4951

Merged
merged 11 commits into from
Jan 11, 2024

Conversation

atomb
Copy link
Member

@atomb atomb commented Jan 8, 2024

Description

Implement support for dafny verify --log-format json to log the information provided in the text format logger in JSON format.

Fixes #4907

How has this been tested?

logger/JsonLogger.dfy

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@atomb atomb marked this pull request as ready for review January 9, 2024 18:26
@atomb atomb requested review from robin-aws and MikaelMayer and removed request for robin-aws January 9, 2024 18:26
@@ -83,5 +83,9 @@ public class ProofDependencyManager {
throw new ArgumentException($"Malformed dependency ID: {component.SolverLabel}");
}
}

public IEnumerable<ProofDependency> GetOrderedFullDependencies(IEnumerable<TrackedNodeComponent> components) {
return components.Select(GetFullIdDependency).OrderBy(dep => (dep.RangeString(), dep.Description));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find ordering by RangeString to be strange. Why not order on the unprinted object: dep.Range.StartToken or dep.Range ?

Also, Instead of the tuple, you can also use the C# chaining ordering API, OrderBy(dep => dep.Range.StartToken).ThenBy(dep => dep.Description), which I think is a little easier to read.

@keyboardDrummer keyboardDrummer enabled auto-merge (squash) January 10, 2024 16:53
Copy link
Contributor

@alex-chew alex-chew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes since Remy's last approval LGTM.

@@ -0,0 +1,453 @@
// RUN: %diff "%s" "%s"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is there a reason there's so many empty lines at the start of this file?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's because those lines used to be comments and the expected messages in some tests have line numbers based on the contents of this file before removing those comments. I should really update the test to remove the blank lines, and re-number the lines in the expected test output, but that'll be a bit time-consuming, so I haven't yet.

@keyboardDrummer keyboardDrummer merged commit 95b36cc into dafny-lang:master Jan 11, 2024
20 checks passed
atomb added a commit to atomb/dafny that referenced this pull request Jan 11, 2024
keyboardDrummer pushed a commit that referenced this pull request Jan 12, 2024
### Description

Add a feature description for the feature added in #4951.

By submitting this pull request, I confirm that my contribution is made
under the terms of the MIT license.
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.

Support verification logs in JSON format
3 participants