Skip to content

Conversation

@sandydoo
Copy link
Member

I've decided to go with the "duplicate the thing and move on" migration approach. Here's why:

  1. hooks.nix doesn't operate at the submodule level. Migrations need to be added to the hooks submodule in pre-commit.nix, which is a bit of a mess.

  2. mkAliasOptionModule and mkRenamedOptionModule work (with the above caveat). However, the former makes it impossible AFAIKT to implement warnings because of the two-way aliasing, and the latter will always spew warnings when we eval enable.

  3. Once we split up hooks.nix and have each hook in a separate module, I think we can revisit hook migrations. Until then, the dumb solution is better than a half-baked smart one.

Fixes #507. Sort of. For now.

I've decided to go with the "duplicate the thing and move on" migration approach.
Here's why:

1. `hooks.nix` doesn't operate at the submodule level.
   Migrations need to be added to the hooks submodule in `pre-commit.nix`, which is a bit of a mess.

2. `mkAliasOptionModule` and `mkRenamedOptionModule` work (with the above caveat).
   However, the former makes it impossible AFAIKT to implement warnings because of the two-way aliasing, and the latter will always spew warnings when we eval `enable`.

3. Once we split up `hooks.nix` and have each hook in a separate module, I think we can revisit hook migrations.
   Until then, the dumb solution is better than a half-baked smart one.
@domenkozar domenkozar merged commit 7106561 into master Oct 13, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement proper migrations for renamed hooks

3 participants