forked from allenap/firstaide
-
Notifications
You must be signed in to change notification settings - Fork 1
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
make hooks messages configurable #162
Open
zach-sherman
wants to merge
3
commits into
NoRedInk:master
Choose a base branch
from
zach-sherman:zach/config-hooks-msgs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
...and update them to reflect current usage why: - these messages appeared to be just wrong (referencing `aide` instead of firstaide or an `update` command that doesn't appear to exist) - and in any case it's nice to have them all customizeable not just the getting_started message. based on the presence of the `Messages` struct I presume this was always intended how: - add fields to `Messages` struct, named based on the hook they are associated with - set sensible defaults for messages - add messages to the hooks scripts - splat configured messages into hooks scripts based on how it was done for the getting_started message docs: updated the readme to document messages configuration validation: tested new message configurations in a different project, `cargo test`
...and update them to reflect current usage why: - these messages appeared to be just wrong (referencing `aide` instead of firstaide or an `update` command that doesn't appear to exist) - and in any case it's nice to have them all customizeable not just the getting_started message. based on the presence of the `Messages` struct I presume this was always intended how: - add fields to `Messages` struct, named based on the hook they are associated with - set sensible defaults for messages - add messages to the hooks scripts - splat configured messages into hooks scripts based on how it was done for the getting_started message docs: updated the readme to document messages configuration validation: tested new message configurations in a different project, `cargo test`
here's a demo of how the default messages show up now: $ .cache/firstaide-bin/bin/firstaide build
2023-10-25 10:50:42 INFO Allow direnv in "/Users/z".
2023-10-25 10:50:42 INFO Create cache dir at ".cache/firstaide-cache".
2023-10-25 10:50:42 INFO Capture outside environment.
⠙ 2023-10-25 10:50:43 INFO Capture inside environment (may involve a full build).
⠸ 2023-10-25 10:50:52 INFO Calculate environment diff.
2023-10-25 10:50:52 INFO Calculate file checksums.
⠙ 2023-10-25 10:50:52 INFO Write out cache.
2023-10-25 10:50:52 INFO Update most recent cache file link.
direnv: loading .envrc
direnv: OKAY: Nix environment is up to date!
direnv: This is a minimal environment; subprojects may not be built.
direnv: --> Use firstaide --help to find out what to do next.
direnv: ^^^^^^^^^^^^^^^^
direnv: export +AR +AS +AWS_PROFILE ...
$ rm -rf .cache/firstaide-cache
direnv: loading .envrc
direnv: ERROR: Nix environment is not yet built!
direnv: --> Use build firstaide and run "firstaide build" to build it.
direnv: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
$ firstaide build
2023-10-25 10:51:09 INFO Allow direnv in "/Users/z/".
2023-10-25 10:51:09 INFO Create cache dir at "/Users/z/.cache/firstaide-cache".
2023-10-25 10:51:09 INFO Capture outside environment.
⠙ 2023-10-25 10:51:09 INFO Capture inside environment (may involve a full build).
⠹ 2023-10-25 10:51:12 INFO Calculate environment diff.
2023-10-25 10:51:12 INFO Calculate file checksums.
⠙ 2023-10-25 10:51:12 INFO Write out cache.
2023-10-25 10:51:12 INFO Update most recent cache file link.
direnv: loading .envrc
direnv: OKAY: Nix environment is up to date!
direnv: This is a minimal environment; subprojects may not be built.
direnv: --> Use firstaide --help to find out what to do next.
direnv: ^^^^^^^^^^^^^^^^
direnv: export +AR +AS +AWS_PROFILE ...
# edit flake.nix and:
$ direnv reload
direnv: loading .envrc
direnv: WARNING: Nix environment is out of date!
direnv: --> Use firstaide build to rebuild it.
direnv: ^^^^^^^^^^^^^^^
direnv: WARNING: Loading STALE environment ;-( |
...and update them to reflect current usage why: - these messages appeared to be just wrong (referencing `aide` instead of firstaide or an `update` command that doesn't appear to exist) - and in any case it's nice to have them all customizeable not just the getting_started message. based on the presence of the `Messages` struct I presume this was always intended how: - add fields to `Messages` struct, named based on the hook they are associated with - set sensible defaults for messages - use serde default attributes to allow mixing defaults and custom messages without errors - add messages to the hooks scripts - splat configured messages into hooks scripts based on how it was done for the getting_started message docs: updated the readme to document messages configuration validation: tested new message configurations in a different project, `cargo test`
zach-sherman
force-pushed
the
zach/config-hooks-msgs
branch
from
October 25, 2023 18:44
731286a
to
ea6116d
Compare
aaand now it allows you to mix default + custom messages. let me know if there's anything else you'd like to see! |
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.
...and update them to reflect current usage
why:
aide
instead of firstaide or anupdate
command that doesn't appear to exist)Messages
struct I presume this was always intendedhow:
Messages
struct, named based on the hook they are associated withdocs: updated the readme to document messages configuration
validation: tested new message configurations in a different project,
cargo test