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.
Background
Creating this as only a proposal for now; as I had written the majority of code required for this change-set in #134 I figured I'd create it anyway.
This changeset could be seem as covering #90 but has a caveat that the underlying technology is generally a unix-only option leading to a need to either:
Why
Why
nix
when it is known to have a reasonable learning curve?Non-Blocking
If considered suitable; I would suggest we keep the check run as not-required and instead it can provide value by providing feedback on how adherent a PR is to the listed checks above.
Reproducibility
Nix enables reproducibility rather than just repeatability; if the checks pass on your machine utilising this mechanism, it'll absolutely pass within the checks flow also, the only possible caveat to this will be if a macOS or Windows opinion differs from Linux; only as the checks run will run under Linux;
Between macOS and Linux I've never seen this eventuate. I cannot speak for Windows; but in the Windows case I believe the only reasonable approaches to run this would be via docker anyway.
Enabler of Auto-Merge
Currently the repository does not have auto merges enabled; this could be utilised as an approach to ensuring rigour of a changeset that enables this feature to be enabled
Features
In essence, the added
flake.*
files and.envrc
allow a user who hasnix
installed to runnix flake check
to ensure all code adheres to checks described here:*nix
files that are evaluated is unused or proposes removing it*nix
code (plus the custom write check I've written enforces those opinions)How
These checks can be adopted into a workflow via direnv running or via nix develop which will install the hooks at shell start time and provide the listed packages also as an ephemeral shell.
Examples
An example of all checks passing is as per this actions run, if ran locally it would emit the following when in verbose mode:
Further
An example of utilising this integrated with git hooks (change on the right is the modification the hook as applied, left is git error log)
Treefmt is supported by the underlying git-hooks.nix repository and might be a good option to centralise all checks if this change-set is considered suitable.
Next Steps
Feel free to provide feedback; good and bad; I'm happy to enable conversation to clarify anything required on the above ❤️