chore: improve code formatting support#127
Merged
pgj merged 4 commits intocloudant-labs:mainfrom Jan 22, 2026
Merged
Conversation
9596e86 to
c796ac9
Compare
rnewson
approved these changes
Jan 21, 2026
jiahuili430
reviewed
Jan 21, 2026
| scalafmt-format: | ||
| @scalafmt --quiet | ||
|
|
||
| .PHONY: format-code |
Contributor
There was a problem hiding this comment.
How about simplifying it to fmt?
Contributor
Author
There was a problem hiding this comment.
It would not be consistent with other targets such as erlfmt-format and scalafmt-format so I think it is better keep it like that.
Contributor
There was a problem hiding this comment.
As we discussed at the meeting, it's up to you.
Since the project uses a code format implemented by `scalafmt`, it might be useful to provide a dedicated `make(1)` target, `scalafmt-format` for developers to invoke the command. This is created in line with the existing `erlfmt-format` that works with Erlang sources. While here, add an extra `format-code` target that calls both `scalafmt-format` and `erlfmt-format` for convenience.
So far we have not enforced the code formatting style via the CI, but probably it is time to do. Especially that we have a dedicated `make(1)` target along with support for installing all the appropriate tools.
93cca1e to
e91a374
Compare
The `ci-lint` target includes commands that pipe their output to a log file but their failure will not stop `make(1)` because the errors are not propagated in this case. Fix this by enabling `pipefail` for running of those. As a consequence, the failed `make(1)` target might be then used to halt the CI on code formatting problems.
93cca1e to
5177339
Compare
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since the project uses a code format implemented by
scalafmt, it might be useful to provide a dedicatedmake(1)target,scalafmt-formatfor developers to invoke the command. This is created in line with the existingerlfmt-formatthat works with Erlang sources.While here, add an extra
format-codetarget that calls bothscalafmt-formatanderlfmt-formatfor convenience. Also, extend the CI with calling the linters for running source code checks on the pull requests.