Skip to content

Format code with fourmolu #2382

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

Merged
merged 21 commits into from
Mar 19, 2021
Merged

Format code with fourmolu #2382

merged 21 commits into from
Mar 19, 2021

Conversation

ttuegel
Copy link
Contributor

@ttuegel ttuegel commented Feb 1, 2021

This pull request would apply formatting with Fourmolu automatically. This avoids problems with stylish-haskell and it removes the need for us to manually attend to the style guide. I think the advantages of perfectly-consistent formatting for readability and code review outweigh the disadvantage that the code will sometimes be formatted differently than we would have chosen ourselves.

Fixes #2415.


Review checklist

The author performs the actions on the checklist. The reviewer evaluates the work and checks the boxes as they are completed.

  • Summary. Write a summary of the changes. Explain what you did to fix the issue, and why you did it. Present the changes in a logical order. Instead of writing a summary in the pull request, you may push a clean Git history.
  • Documentation. Write documentation for new functions. Update documentation for functions that changed, or complete documentation where it is missing.
  • Tests. Write unit tests for every change. Write the unit tests that were missing before the changes. Include any examples from the reported issue as integration tests.
  • Clean up. The changes are already clean. Clean up anything near the changes that you noticed while working. This does not mean only spatially near the changes, but logically near: any code that interacts with the changes!

@ttuegel
Copy link
Contributor Author

ttuegel commented Feb 1, 2021

If we decide to adopt fourmolu, we should remove the separation between "groups" in our import lists, so we can take advantage of automatically managing imports.

@ttuegel ttuegel force-pushed the fourmolu branch 2 times, most recently from aaef26b to 5730e66 Compare February 23, 2021 20:17
@ttuegel ttuegel force-pushed the fourmolu branch 3 times, most recently from bf1cec4 to 000f13d Compare March 10, 2021 02:07
@ttuegel ttuegel marked this pull request as ready for review March 10, 2021 22:36
@ttuegel
Copy link
Contributor Author

ttuegel commented Mar 10, 2021

When this is merged, here is how to resolve conflicts with your pull request branch.

git switch master
git pull upstream  # Replace 'upstream' with however you call kframework/kore.
git log  # Find the commit hash of this pull request after it is merged; it is called '$commit' below.
git switch pr-branch  # Replace 'pr-branch' with the name of your branch.
git merge $commit~1
# Resolve conflicts in the usual way.
git merge $commit  # The only conflicts will be due to formatting.
./scripts/resolve-conflicts.sh pr-branch
git commit
# There may still be some conflicts due to files that were deleted.
# Resolve these conflicts the normal way.
git push  # Push changes to GitHub. They will be reformatted automatically.

@ttuegel ttuegel changed the title Format with fourmolu Format code with fourmolu Mar 12, 2021
ttuegel added 5 commits March 12, 2021 11:33
# Conflicts:
#	kore/src/Kore/Builtin.hs
#	kore/src/Kore/Builtin/AssociativeCommutative.hs
#	kore/src/Kore/Builtin/Builtin.hs
#	kore/src/Kore/Builtin/External.hs
#	kore/src/Kore/Builtin/Int.hs
#	kore/src/Kore/Builtin/InternalBytes.hs
#	kore/src/Kore/Builtin/KEqual.hs
#	kore/src/Kore/Builtin/Krypto.hs
#	kore/src/Kore/Builtin/Map.hs
#	kore/src/Kore/Builtin/Set.hs
#	kore/src/Kore/Builtin/String.hs
#	kore/src/Kore/Equation/Application.hs
#	kore/src/Kore/Internal/SideCondition.hs
#	kore/src/Kore/Internal/Substitution.hs
#	kore/src/Kore/Internal/TermLike.hs
#	kore/src/Kore/Internal/TermLike/TermLike.hs
#	kore/src/Kore/Reachability/Claim.hs
#	kore/src/Kore/Step/Axiom/Matcher.hs
#	kore/src/Kore/Step/SMT/Evaluator.hs
#	kore/src/Kore/Step/SMT/Lemma.hs
#	kore/src/Kore/Step/SMT/Translate.hs
#	kore/src/Kore/Step/Simplification/AndTerms.hs
#	kore/src/Kore/Step/Simplification/Ceil.hs
#	kore/src/Kore/Step/Simplification/Defined.hs
#	kore/src/Kore/Step/Simplification/Exists.hs
#	kore/src/Kore/Step/Simplification/Pattern.hs
#	kore/src/Kore/Step/Simplification/Simplify.hs
#	kore/src/Kore/Step/Simplification/TermLike.hs
#	kore/test/Test/ConsistentKore.hs
#	kore/test/Test/Kore/Builtin/AssociativeCommutative.hs
#	kore/test/Test/Kore/Builtin/Map.hs
#	kore/test/Test/Kore/Builtin/Set.hs
#	kore/test/Test/Kore/Internal/SideCondition.hs
#	kore/test/Test/Kore/Internal/TermLike.hs
#	kore/test/Test/Kore/Step/Axiom/Matcher.hs
#	kore/test/Test/Kore/Step/SMT/Evaluator.hs
#	kore/test/Test/Kore/Step/SMT/Symbols.hs
#	kore/test/Test/Kore/Step/SMT/Translate.hs
#	kore/test/Test/Kore/Step/Simplification/AndTerms.hs
#	kore/test/Test/Kore/Step/Simplification/Condition.hs
#	kore/test/Test/Kore/Step/Simplification/Integration.hs
@rv-jenkins rv-jenkins merged commit 4f3a751 into master Mar 19, 2021
@rv-jenkins rv-jenkins deleted the fourmolu branch March 19, 2021 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable Fourmolu
5 participants