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

Add --check flag to dhall {lint,freeze} #1636

Merged
merged 10 commits into from
Jan 20, 2020
Merged

Add --check flag to dhall {lint,freeze} #1636

merged 10 commits into from
Jan 20, 2020

Conversation

Gabriella439
Copy link
Collaborator

Fixes #1629

The main changes here are:

  • Transposing FormatMode from (conceptually) Either FilePath FilePath to (Bool, FilePath)
  • Generalizing FormatMode and NotFormatted to be usable for linting and freezing, too
  • Improving the error message if --check fails (which was previously blank)

Copy link
Collaborator

@sjakobi sjakobi left a comment

Choose a reason for hiding this comment

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

I was briefly confused about the PR title. I think you meant {lint,freeze}.

I really like that format, freeze and lint have such a uniform API now! :)

I think it's a bit awkward that to check a file, you have to write e.g. dhall freeze --check --inplace x.dhall--inplace doesn't really make sense in this combination. I don't see an easy way to resolve that though.

dhall/src/Dhall/Util.hs Outdated Show resolved Hide resolved
dhall/src/Dhall/Util.hs Outdated Show resolved Hide resolved
dhall/src/Dhall/Main.hs Show resolved Hide resolved
dhall/src/Dhall/Freeze.hs Outdated Show resolved Hide resolved
@Gabriella439
Copy link
Collaborator Author

Yeah, I mean dhall {lint,freeze}. Also, the only reason I kept the use of --inplace was for consistency with the current dhall format --check command

@sjakobi sjakobi changed the title Add --check flag to dhall {lint,format} Add --check flag to dhall {lint,freeze} Jan 19, 2020
Copy link
Collaborator

@sjakobi sjakobi left a comment

Choose a reason for hiding this comment

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

Cheers!

Just a few more wibbles. ;)

dhall/src/Dhall/Freeze.hs Outdated Show resolved Hide resolved
dhall/src/Dhall/Freeze.hs Outdated Show resolved Hide resolved
dhall/src/Dhall/Main.hs Outdated Show resolved Hide resolved
dhall/src/Dhall/Util.hs Outdated Show resolved Hide resolved
@mergify mergify bot merged commit 793ec53 into master Jan 20, 2020
@mergify mergify bot deleted the gabriel/check branch January 20, 2020 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dhall freeze --verify
2 participants