Commit Graph

7 Commits

Author SHA1 Message Date
Jean-Hadrien Chabran
ded610d887
chore(local): add FORBIDCOMMIT pragma to prevent accidental commits (#63581)
@chrsmith suggested this idea, which I like very much as well. 

Pretty straightforward: 

- if you're adding something you really don't want to commit and suspect
your future self to forget about it, you can add `FORBIDCOMMIT` anywhere
in your changes, and precommit will prevent you from accidentally
committing it.
  - check is case insensitive.

I went for this instead of `NOCOMMIT` because it could be legitimately
be used for a var with the number of commits for example. And that's not
really something we want to add a pragma to disable the string itself
for either.


## Test plan

![CleanShot 2024-07-01 at 19 44
31@2x](https://github.com/sourcegraph/sourcegraph/assets/10151/3ff3420e-4012-4018-a1e3-42ae2fb53cb4)
2024-07-01 18:27:26 +00:00
William Bezuidenhout
f9f633bcfd
exclude pnpm-lock.yaml from precommit (#61158) 2024-03-14 15:35:14 +00:00
Noah S-C
bc97fdbe34
add shellcheck & shfmt to pre-commit's pre-push hook (#59485)
Closes https://github.com/sourcegraph/sourcegraph/issues/54829

Next steps: 
- what safeguards will we have in place for when we remove this from `sg lint`
- should we remove it from `sg lint`, its likely not contributing much overhead even in the uncommon case of shell files being touched

_How did some of these violations get in when theres shell lints :clueless:_

## Test plan

`pre-commit run --hook-stage=pre-push shellcheck shfmt`
2024-01-11 14:16:22 +00:00
Jean-Hadrien Chabran
865ab5329e
local: don't let pre-commit run no DB md files (#58094) 2023-11-03 08:50:10 +00:00
Jean-Hadrien Chabran
1f60607c16
local: exclude generated files from pre-commit (#57761) 2023-10-20 08:19:40 +00:00
Anton Sviridov
39a12bcd7b
Java queries for local navigation (#57620) 2023-10-20 08:07:33 +01:00
Jean-Hadrien Chabran
0cc59e41c5
dev: add a pre-commit hook to searches for tokens (#56499) 2023-09-12 16:20:44 +02:00