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

format check --standard-libraries (or including any doo files) always fails #6021

Open
robin-aws opened this issue Jan 7, 2025 · 0 comments
Labels
kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label

Comments

@robin-aws
Copy link
Member

Dafny version

4.9.1

Code to produce this issue

module UsesWrappers {

  import opened Std.Wrappers

  function SafeDiv(a: int, b: int): Option<int> {
    if b == 0 then None else Some(a/b)
  }
}

Command to run and resulting output

> dafny format --check --standard-libraries UsesStdLibs.dfy
The file /DafnyStandardLibraries-notarget.doo needs to be formatted
The file /DafnyStandardLibraries.doo needs to be formatted
Error: 2 files need formatting.

What happened?

I'd expect the standard libraries to not be in scope for formatting in general, given they are pre-built. Or at least if they are in scope, they would be considered correctly formatted.

This is a general doo file problem and not specific to the standard libraries. dafny format without the check already produces Please use the '--check' and/or '--print' option as doo files cannot be formatted in place.

There's a fairly easy workaround as you don't actually need to pass --standard-libraries to dafny format, since it doesn't attempt resolution. But that's not easy when using a project file, for example.

What type of operating system are you experiencing the problem on?

Mac

@robin-aws robin-aws added the kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
Projects
None yet
Development

No branches or pull requests

1 participant