Commit d220ff6 1 parent 9f73b29 commit d220ff6 Copy full SHA for d220ff6
File tree 3 files changed +54
-0
lines changed
3 files changed +54
-0
lines changed Original file line number Diff line number Diff line change
1
+ repos :
2
+ - repo : https://github.com/pre-commit/pre-commit-hooks
3
+ rev : v4.4.0
4
+ hooks :
5
+ - id : check-added-large-files
6
+ - id : check-toml
7
+ - id : check-merge-conflict
8
+ - id : end-of-file-fixer
9
+ - repo : https://github.com/doublify/pre-commit-rust
10
+ rev : v1.0
11
+ hooks :
12
+ # - id: fmt
13
+ - id : cargo-check
14
+ - id : clippy
15
+ - repo : https://github.com/alessandrojcm/commitlint-pre-commit-hook
16
+ rev : v9.4.0
17
+ hooks :
18
+ - id : commitlint
19
+ stages : [commit-msg]
20
+ additional_dependencies :
21
+ - " @team23/commitlint-config@1.0.0"
22
+
23
+ default_stages :
24
+ - commit
25
+
26
+ default_install_hook_types :
27
+ - pre-commit
28
+ - commit-msg
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ extends : [ '@team23/commitlint-config' ] ,
3
+ } ;
Original file line number Diff line number Diff line change @@ -9,6 +9,18 @@ def "nur hello" [
9
9
10
10
# Actual useful tasks
11
11
12
+ # Setup local environment and install deps
13
+ def "nur install" [] {
14
+ cargo fetch
15
+
16
+ init-pre-commit
17
+ }
18
+
19
+ # Update local dev environment
20
+ def "nur update" [] {
21
+ cargo fetch
22
+ }
23
+
12
24
# Run cargo
13
25
def --wrapped "nur cargo" [...args: string] {
14
26
cargo ...$args
@@ -100,3 +112,14 @@ def "nur upgrade-nu" [
100
112
print $" -> (ansi cyan)nu-ansi-term(ansi reset): needs to be the same version as used in (ansi cyan)nu-cli(ansi reset)"
101
113
print $" -> (ansi cyan)miette(ansi reset): needs to be the same version as used in (ansi cyan)nu-cmd-base(ansi reset)"
102
114
}
115
+
116
+ # Utility commands
117
+
118
+ def init-pre-commit [] {
119
+ if (which pre-commit | is-empty) {
120
+ print -e $"(ansi red)You don't have pre-commit installed locally, pre-commit hooks cannot be initialized(ansi reset)"
121
+ return null
122
+ }
123
+
124
+ pre-commit install --install-hooks
125
+ }
You can’t perform that action at this time.
0 commit comments