Skip to content

feat: support specifying stages, close #49 #79

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

Merged
merged 2 commits into from
Nov 4, 2020

Conversation

blaggacao
Copy link
Contributor

replace #52 (rebased & squashed)

@blaggacao
Copy link
Contributor Author

blaggacao commented Nov 2, 2020

unrelated: pre-commit does append to path and not override existing pre-commit
PATH=/home/blaggacao/.nix-profile/bin:/nix/store/v9dasbp7zqriainlak5hc2idpr8cmcn1-vicidial-go-env/bin:/nix/store/6h0xx5d8wwl8zf7g4x2sjl0q4hr3nnb4-bash-interactive-4.4-p23/bin:/home/blaggacao/.oh-my-zsh/custom/plugins/nix-shell/scripts:/home/blaggacao/.nix-profile/bin:/home/blaggacao/.cargo/bin:/home/blaggacao/.npm-global/bin:/home/blaggacao/.poetry/bin:/home/blaggacao/go/bin:/home/blaggacao/bin:/home/blaggacao/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/local/go/bin:/snap/bin:/home/blaggacao/.fzf/bin:/home/blaggacao/.nix-profile/bin:/home/blaggacao/.cargo/bin:/home/blaggacao/.npm-global/bin:/home/blaggacao/.poetry/bin:/home/blaggacao/go/bin:/home/blaggacao/bin:/home/blaggacao/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/games:/usr/local/go/bin:/snap/bin:/home/blaggacao/.fzf/bin:/nix/store/dqlx77d224grs7ch39jhgfplf68mg6sl-python3.8-pre-commit-2.7.1/bin

beware I'm hitting this: (from an earlier contribution about shellcheck detection)

$ pre-commit run --all --hook-stage manual generate
An error has occurred: InvalidConfigError:
==> File .pre-commit-config.yaml
==> At Config()
==> At key: repos
==> At Repository(repo='local')
==> At key: hooks
==> At Hook(id='shellcheck')
==> At key: types
==> At index 1
=====> Type tag 'ash' is not recognized.  Try upgrading identify and pre-commit?
Check the log at /home/blaggacao/.cache/pre-commit/pre-commit.log
$ pre-commit --version
pre-commit 2.5.1
builtins.fetchTarball {
  # git ls-remote https://github.com/nixos/nixpkgs nixpkgs-unstable

  # unstable
  url = "https://github.com/nixos/nixpkgs/tarball/26d3fbf21563c52f124551eb60dec5ea17ade8fa";
  sha256 = "sha256:08xhvfnwy60yyyhkddg7lknm9g7w2pg6lkyha5kfkg98c09f1p10";
}

(from today)

@blaggacao blaggacao force-pushed the da-add-support-for-stages branch from fdfa7a3 to eff2d0d Compare November 2, 2020 03:25
fi
case $stage in
# if you amend these switches please also review $hooks above
commit | merge-commit | push)
Copy link
Member

Choose a reason for hiding this comment

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

Why do we diverge from pre-commit settings by not just specifying pre-push instead of push?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Precommit has two identifiers "push" (the stage) and "pre-push" (the hook) in an attempt to be extra "correct" about things, while achieving only plain confusion. Here it's "push" (the stage).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ps: I also wondered and got bitten. More than once.

Co-authored-by: Domen Kožar <[email protected]>
@domenkozar domenkozar merged commit 9bc92ae into cachix:master Nov 4, 2020
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.

2 participants