Skip to content

[WPB-28280] Automate license header updates in treefmt. - #5481

Merged
fisx merged 4 commits into
developfrom
WPB-28280-automate-license-header-updates-in-treefmt
Aug 26, 2026
Merged

[WPB-28280] Automate license header updates in treefmt.#5481
fisx merged 4 commits into
developfrom
WPB-28280-automate-license-header-updates-in-treefmt

Conversation

@fisx

@fisx fisx commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

https://wearezeta.atlassian.net/browse/WPB-28280

Checklist

  • Add a new entry in an appropriate subdirectory of changelog.d
  • Read and follow the PR guidelines

@zebot zebot added the ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist label Aug 26, 2026
- Re-add headroom to treefmt;
- make old license headers static;
- make new license headers reference _current_year, not 2025.
@fisx
fisx force-pushed the WPB-28280-automate-license-header-updates-in-treefmt branch from eaea003 to 32b4a26 Compare August 26, 2026 10:28
@fisx

fisx commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

linter on CI says this:

+ make lint-all
./tools/ormolu.sh -c
Formatting branch origin/main in services/wire-server-enterprise
ormolu mode: check
language extensions are taken from the resp. cabal files
Checking 8 file(s)…
test/Test/Enterprise/DNS/VerifyDomainSpec.hs...  ok
Formatting branch origin/develop in .
ormolu mode: check
language extensions are taken from the resp. cabal files
Checking 1953 file(s)…
tools/test-stats/Main.hs...  ok
./tools/hlint.sh -f all -m check
ERRO file has changed path=libs/wire-subsystems/src/Wire/FeaturesConfigSubsystem/Interpreter.hs prev_size=9235 prev_mod_time="2026-08-26 10:34:45 +0000 UTC" current_size=10024 current_mod_time="2026-08-26 10:45:46 +0000 UTC"
ERRO file has changed path=libs/wire-subsystems/src/Wire/FeaturesConfigSubsystem/Types.hs prev_size=4851 prev_mod_time="2026-08-26 10:34:45 +0000 UTC" current_size=5640 current_mod_time="2026-08-26 10:45:46 +0000 UTC"
ERRO file has changed path=libs/wire-subsystems/src/Wire/IdPSubsystem.hs prev_size=360 prev_mod_time="2026-08-26 10:34:45 +0000 UTC" current_size=1149 current_mod_time="2026-08-26 10:45:46 +0000 UTC"
ERRO file has changed path=libs/wire-subsystems/src/Wire/IdPSubsystem/Interpreter.hs prev_size=5057 prev_mod_time="2026-08-26 10:34:45 +0000 UTC" current_size=5846 current_mod_time="2026-08-26 10:45:46 +0000 UTC"
ERRO file has changed path=libs/wire-subsystems/src/Wire/LegalHold.hs prev_size=955 prev_mod_time="2026-08-26 10:34:45 +0000 UTC" current_size=1744 current_mod_time="2026-08-26 10:45:46 +0000 UTC"
ERRO file has changed path=libs/wire-subsystems/src/Wire/LegalHoldStore/Cassandra/Queries.hs prev_size=2105 prev_mod_time="2026-08-26 10:34:45 +0000 UTC" current_size=2894 current_mod_time="2026-08-26 10:45:46 +0000 UTC"
ERRO file has changed path=libs/wire-subsystems/src/Wire/LegalHoldStore/Env.hs prev_size=469 prev_mod_time="2026-08-26 10:34:45 +0000 UTC" current_size=1258 current_mod_time="2026-08-26 10:45:46 +0000 UTC"
ERRO file has changed path=integration/test/Test/Migration/Util.hs prev_size=838 prev_mod_time="2026-08-26 10:34:44 +0000 UTC" current_size=1627 current_mod_time="2026-08-26 10:45:46 +0000 UTC"

not extremely helpful, but given that make treefmt is implied in all the important make rules, it shouldn't hit too frequently either.

Comment on lines +5 to +8
# treefmt hands us a list of file paths, headroom wants them as repeated
# '-s' arguments. Everything else (templates, variables, run-mode) comes
# from .headroom.yaml, which headroom picks up from the working directory
# (treefmt runs formatters from the root of the tree).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you please create an upstream ticket for this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

About changing headroom's CLI to work with headroom better?

I've tried, but it seems silly to me. Our work-around is fine, and who says that treefmt is right here and doesn't need to be patched to accomodate headroom?

Comment thread Makefile Outdated
headroom run -a
@echo ""
@echo "you might want to run 'make formatf' now to make sure ormolu is happy"
@echo "DEPRECATED: use 'make treefmt' instead (see 'headroom' rule in .treefmt.yaml)."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I would even just delete it

@fisx

fisx commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

renaming files works as expected:

$ mv libs/types-common/src/Data/{LegalHold,WireTapping}.hs
$ make treefmt-check
treefmt --fail-on-change -u debug --walk=git
traversed 6912 files
emitted 2191 files for processing
formatted 0 files (0 changed) in 52ms

@fisx
fisx marked this pull request as ready for review August 26, 2026 11:03
@fisx
fisx requested review from a team as code owners August 26, 2026 11:03
@fisx
fisx merged commit 11f4dd9 into develop Aug 26, 2026
9 checks passed
@fisx
fisx deleted the WPB-28280-automate-license-header-updates-in-treefmt branch August 26, 2026 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Approved for running tests in CI, overrides not-ok-to-test if both labels exist

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants