Skip to content

Commit

Permalink
Merge branch 'evilmartians:master' into skip_only_conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
prog-supdex authored Mar 11, 2024
2 parents 64257bd + ce6c29b commit bbba913
Show file tree
Hide file tree
Showing 41 changed files with 664 additions and 663 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ contact_links:
about: Ask questions and discuss with other `lefthook` users or maintainers.

- name: 🙏 Request help
url: https://github.com/remirror/remirror/discussions/new
url: https://github.com/evilmartians/lefthook/discussions/new
about: Ask the `lefthook` community for help.
3 changes: 2 additions & 1 deletion .lefthook.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ glob = "*.go"

[pre-commit.commands.lychee]
glob = "*.md"
run = "lychee {staged_files}"
exclude = "CHANGELOG\\.md"
run = "lychee --max-concurrency 3 {staged_files}"

[pre-commit.commands.typos]
run = "typos --write-changes {staged_files}"
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

## master (unreleased)

## 1.6.5 (2024-03-04)

- fix: decrease max cmd length for windows ([#666](https://github.com/evilmartians/lefthook/pull/666)) by @mrexox
- deps: Dependencies 04.03.2024 ([#664](https://github.com/evilmartians/lefthook/pull/664)) by @mrexox
- chore: fix Makefile by @mrexox
- docs: fix redundant option by @mrexox

## 1.6.4 (2024-02-28)

- deps: update uniseg ([#650](https://github.com/evilmartians/lefthook/pull/650)) by @technicalpickles

## 1.6.3 (2024-02-27)

- deps: Dependencies (27.02.2024) ([#648](https://github.com/evilmartians/lefthook/pull/648)) by @mrexox
- chore: remove adaptive colors ([#647](https://github.com/evilmartians/lefthook/pull/647)) by @mrexox
- docs: update request help url ([#641](https://github.com/evilmartians/lefthook/pull/641)) by @sbsrnt

## 1.6.2 (2024-02-26)

- fix: respect roots in commands for npm packages ([#616](https://github.com/evilmartians/lefthook/pull/616)) by @mrexox
- fix: don't capture STDIN without interactive or use_stdin options ([#638](https://github.com/evilmartians/lefthook/pull/638)) by @technicalpickles
- fix: handle LEFTHOOK_QUIET when there is no skip_output in config by @prog-supdex
- docs: add stage_fixed to the examples by @mrexxo
- docs: clarify the difference between piped and parallel options by @mrexox

## 1.6.1 (2024-01-24)

- fix: files from stdin only null separated ([#615](https://github.com/evilmartians/lefthook/pull/615)) by @mrexox
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-with-coverage:
go build -cover -ldflags "-s -w -X github.com/evilmartians/lefthook/internal/version.commit=$(COMMIT_HASH)" -o lefthook

install: build
cp lefthook $(GOPATH)/bin/
cp lefthook $$(go env GOPATH)/bin

test:
go test -cpu 24 -race -count=1 -timeout=30s ./...
Expand Down
38 changes: 38 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,46 @@ If you want to specify a minimum version for lefthook binary (e.g. if you need s
min_version: 1.1.3
```

### `output`

You can manage verbosity using the `output` config. You can specify what to print in your output by setting these values, which you need to have

Possible values are `meta,summary,success,failure,execution,execution_out,execution_info,skips`.
By default, all output values are enabled

You can also disable all output with setting `output: false`. In this case only errors will be printed.

This config quiets all outputs except for errors.

`output` is enabled if there is no `skip_output` and `LEFTHOOK_QUIET`.

**Example**

```yml
# lefthook.yml
output:
- meta # Print lefthook version
- summary # Print summary block (successful and failed steps)
- empty_summary # Print summary heading when there are no steps to run
- success # Print successful steps
- failure # Print failed steps printing
- execution # Print any execution logs (but prints if the execution failed)
- execution_out # Print execution output (but still prints failed commands output)
- execution_info # Print `EXECUTE > ...` logging
- skips # Print "skip" (i.e. no files matched)
```
You can also *extend* this list with an environment variable `LEFTHOOK_OUTPUT`:

```bash
LEFTHOOK_OUTPUT="meta,success,summary" lefthook run pre-commit
```

### `skip_output`

> **Deprecated:** This feature is deprecated and might be removed in future versions. Please, use `[output]` instead for managing verbosity.

You can manage the verbosity using the `skip_output` config. You can set whether lefthook should print some parts of its output.

Possible values are `meta,summary,success,failure,execution,execution_out,execution_info,skips`.
Expand Down
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ python3 -m pip install --user lefthook
You can find the Swift wrapper plugin [here](https://github.com/csjones/lefthook-plugin). To utilize lefthook, include the plugin in the dependencies section of your `Package.swift`:

```swift
.package(url: "https://github.com/csjones/lefthook-plugin.git", exact: "1.6.1"),
.package(url: "https://github.com/csjones/lefthook-plugin.git", exact: "1.6.5"),
```

## <a id="scoop"></a> Scoop for Windowss
Expand Down
10 changes: 10 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Then use git as usually, you don't need to reinstall lefthook when you change th
- [`LEFTHOOK_EXCLUDE`](#lefthook_exclude)
- [`LEFTHOOK_QUIET`](#lefthook_quiet)
- [`LEFTHOOK_VERBOSE`](#lefthook_verbose)
- [`LEFTHOOK_BIN`](#lefthook_bin)
- [Features and tips](#features-and-tips)
- [Disable lefthook in CI](#disable-lefthook-in-ci)
- [Local config](#local-config)
Expand Down Expand Up @@ -192,6 +193,15 @@ SUMMARY: (done in 0.01 seconds)

Set `LEFTHOOK_VERBOSE=1` or `LEFTHOOK_VERBOSE=true` to enable verbose printing.

### `LEFTHOOK_BIN`

Set `LEFTHOOK_BIN` to a location where lefthook is installed to use that instead of trying to detect from the it the PATH or from a package manager.

Useful for cases when:

- lefthook is installed multiple ways, and you want to be explicit about which one is used (example: installed through homebrew, but also is in Gemfile but you are using a ruby version manager like rbenv that prepends it to the path)
- debugging and/or developing lefthook

## Features and tips

### Disable lefthook in CI
Expand Down
4 changes: 3 additions & 1 deletion examples/commitlint/lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ prepare-commit-msg:
commands:
commitzen:
interactive: true
run: LEFTHOOK=0 yarn run cz
run: yarn run cz
env:
LEFTHOOK: 0

# Use this to validate commit messages
commit-msg:
Expand Down
41 changes: 23 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,50 @@ go 1.21
require (
github.com/MakeNowJust/heredoc v1.0.0
github.com/briandowns/spinner v1.23.0
github.com/charmbracelet/lipgloss v0.6.0
github.com/creack/pty v1.1.18
github.com/charmbracelet/lipgloss v0.9.1
github.com/creack/pty v1.1.21
github.com/gobwas/glob v0.2.3
github.com/google/go-cmp v0.5.9
github.com/mitchellh/mapstructure v1.5.0
github.com/rogpeppe/go-internal v1.11.0
github.com/spf13/afero v1.9.5
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.16.0
github.com/rogpeppe/go-internal v1.12.0
github.com/spf13/afero v1.11.0
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.18.2
gopkg.in/alessio/shellescape.v1 v1.0.0-20170105083845-52074bc9df61
)

require (
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
golang.org/x/tools v0.6.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/tools v0.13.0 // indirect
)

require (
github.com/alessio/shellescape v1.4.1 // indirect
github.com/fatih/color v1.14.1 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mattn/go-isatty v0.0.20
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.15.1 // indirect
github.com/pelletier/go-toml/v2 v2.0.9
github.com/rivo/uniseg v0.2.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/muesli/termenv v0.15.2 // indirect
github.com/pelletier/go-toml/v2 v2.1.1
github.com/rivo/uniseg v0.4.7 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
golang.org/x/sys v0.8.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1
)
Loading

0 comments on commit bbba913

Please sign in to comment.