-
Notifications
You must be signed in to change notification settings - Fork 160
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
Move to new module structure #397
Conversation
Here's where we're currently at: {
hooks.ormolu.enable = true;
hooks.ormolu.package = pkgs.ormolu.override { ... }; # still need to add lib.mkDefault everywhere
hooks.ormolu.settings.defaultExtensions = [ "lhs" "hs" ];
} What else do we want to include here? I've outlined what needs to get done above, but there are some bits I don't fully understand, like the non-pre-commit hook stuff. |
There's |
These should be reused by all the hooks that use rust bits. |
Nice! Does that always work? What should we do with hooks like this? It's suggesting to set a local path. Should all hooks be able to override the path to the binary? Is
|
🥳 🥳 🥳 |
Based on #196.
e750d99
to
8af5964
Compare
Looks good to me. Do we need some kind of migration guide or will the warnings system take care of it all (minus the bugs)? |
A good idea either way! @domenkozar, what do you think of this fee04a7? |
Nice :) let's ship this. |
I think this PR is causing the following issue (specifically with the flake.parts module?):
|
@nifoc, thanks, will fix |
Damn, I didn't see the ping. What happened to I'm getting |
@sandydoo do you know? |
Not sure I understand where the error is coming from. Like the per-hook enable? It should be there 🤷 |
- Remove `before` and `after` from the `raw` config. These are not valid pre-commit configuration options and should not be here. - Remove code to filter out `before` and `after` from the `raw` config. - Expose the `id` inside the hook to make it easier to reference and sort. - Set `id` to the attr name of the hook, instead of the `name`. This corrects a mistake make in the module transition (#397). Technically, a breaking change, but we haven't seen feedback on the initial mistake.
- Remove `before` and `after` from the `raw` config. These are not valid pre-commit configuration options and should not be here. - Remove code to filter out `before` and `after` from the `raw` config. This is not needed if they're not in the config in the first place. - Expose the `id` inside the hook to make it easier to reference and sort. - Set `id` to the attr name of the hook, instead of the `name`. This corrects a mistake made in the module transition (#397). Technically, a breaking change, but we haven't had feedback from the initial mistake.
Consolidates previous work from #533 and #536. - Removes `before` and `after` from the `raw` config. These are not valid pre-commit configuration options and should not be here. - Removes code to filter out `before` and `after` from the `raw` config. There's nothing to filter out if they're not in the config in the first place. - Set `id` to the attr name of the hook, instead of the `name`. This corrects a mistake made in the module transition (#397). Technically, a breaking change, but we haven't had feedback from the initial mistake. - Expose `id` in options.
Consolidates previous work from #533 and #536. - Removes `before` and `after` from the `raw` config. These are not valid pre-commit configuration options and should not be here. - Removes code to filter out `before` and `after` from the `raw` config. There's nothing to filter out if they're not in the config in the first place. - Set `id` to the attr name of the hook, instead of the `name`. This corrects a mistake made in the module transition (#397). Technically, a breaking change, but we haven't had feedback from the initial mistake. - Expose `id` in options.
Tackles #196.
Tasks
options.settings.<name>
tooptions.hooks.<name>.settings
package
to the hook modulesettings.rust
.lib.mkDefault
on hook definitions to make overrides easierhooks.<name>.settings.package
tohooks.<name>.package
.nix build .#checks.<system>.doc-check
.Out of scope
tools
? Breaking change 🤔options.hooks
so that they appear in the docs.Issues to tackle
Some hooks depend on a custom, more complex package. These are difficult to override.
Many hooks have adopted
binPath
in lieu ofpackage
. Should these be deprecated and migrated topackage
?Here's an interesting case: you can provide a path to the local
node_modules
folder instead.Solved: I've kept
binPath
around, but set it tonull
by default. Hooks will usebinPath
if it's set, but otherwise default topackage
.There is a special
options.settings.rust
option that is shared amongst some hooks. It's not a hook itself. We need to define the module type foroptions.settings
.Solved: moved to
options.settings.rust
.Some packages already use
package
as a setting. Need to migrate these.Solved: renamed and deprecated.
mkRenamedOptionModule
isn't showing any warnings. Is it because of the submodules?Solved: added assertions/warnings handling
Misc fixes
credo.settings.strict
is enabled.