File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 118118 files : (?i)\.R$
119119 pass_filenames : true
120120 minimum_pre_commit_version : 0.15.0
121- description : ' Run lintr against R code'
121+ description : ' Run lintr against R code'
122+
123+ - id : buf-lint
124+ name : ' Lint protobuf files'
125+ entry : buf-lint.sh
126+ types : [proto]
127+ language : ' script'
128+ pass_filenames : false
129+ minimum_pre_commit_version : 0.15.0
130+ description : " Runs buf lint at the repo root"
131+
132+ - id : buf-breaking
133+ name : ' Check protobuf for breaking changes'
134+ entry : buf-breaking.sh
135+ types : [proto]
136+ language : ' script'
137+ pass_filenames : false
138+ minimum_pre_commit_version : 0.15.0
139+ description : " Runs buf breaking at the repo root"
Original file line number Diff line number Diff line change 1818* ` rust-fmt ` : runs ` cargo fmt --all `
1919* ` r-stylr ` : runs [ ` stylr ` ] to format R code
2020* ` r-lintr ` : static analysis of R code with [ ` lintr ` ]
21+ * ` buf-lint ` : runs [ ` buf ` ] lints against protobuf files
22+ * ` buf-breaking ` : protobuf breaking change detection using [ ` buf ` ]
2123
2224## Example config
2325
6466 stages : [commit, push]
6567
6668 - id : rust-clippy
67- # args: [ # Optionally override default configured lints
69+ # args: [ # Optionally override default configured lints
6870 # "-D rust_2018_idioms",
6971 # "-D missing_docs",
7072 # ]
@@ -81,6 +83,15 @@ repos:
8183
8284 - id : r-lintr
8385 stages : [commit, push]
86+ stages : [commit, push]
87+
88+ - id : buf-lint
89+ stages : [commit, push]
90+
91+ - id : buf-breaking
92+ # Checks against 'master' branch by defaut, change with:
93+ # args: [".git#tag=v1.0.0"]
94+ stages : [commit, push]
8495` ` `
8596
8697## Tagged TODOs
@@ -129,4 +140,5 @@ When adding new hooks you can run `pre-commit try-repo .` for a quick syntax che
129140[dep] : https://github.com/golang/dep
130141[`post-checkout`] : https://git-scm.com/docs/githooks#_post_checkout
131142[`stylr`] : https://styler.r-lib.org/
132- [`lintr`] : https://github.com/jimhester/lintr
143+ [`lintr`] : https://github.com/jimhester/lintr
144+ [`buf`] : https://buf.build/
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # Protobuf breaking change detection with Buf: https://docs.buf.build/
4+ #
5+ # To run the checks locally:
6+ # buf breaking
7+ #
8+ # To view the breaking change lints:
9+ # buf config ls-breaking-rules
10+
11+ set -euo pipefail
12+
13+ # Default to checking against the local master Git branch
14+ against=${1-' .git#branch=master' } ;
15+
16+ buf breaking " ${against} "
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # Protobuf linting with Buf: https://docs.buf.build/
4+ #
5+ # To run the lints locally:
6+ # buf lint
7+ #
8+ # To view the available lints and their descriptions:
9+ # buf config ls-lint-rules
10+
11+ set -euo pipefail
12+
13+ buf lint " $@ "
You can’t perform that action at this time.
0 commit comments