Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Analyze your changeset in a branch before git push using SonarLint + Git hooks; Round #2
Search
Janos Gyerik
December 08, 2016
Technology
0
590
Analyze your changeset in a branch before git push using SonarLint + Git hooks; Round #2
Janos Gyerik
December 08, 2016
Tweet
Share
More Decks by Janos Gyerik
See All by Janos Gyerik
Capture The Flag at SonarSource 2019
janosgyerik
1
29
Keyboard shortcuts
janosgyerik
0
120
Analyze your changeset in a branch before git push using SonarLint + Git hooks
janosgyerik
0
290
Unwatch GitHub repos
janosgyerik
0
280
Code Reviews
janosgyerik
0
130
Playing with Yahoo! Pipes
janosgyerik
0
210
Cool features of GitHub
janosgyerik
0
1.2k
Time-saving tricks on the command line
janosgyerik
1
3.9k
Other Decks in Technology
See All in Technology
On Your Data を超えていく!
hirotomotaguchi
2
660
ServiceNow Knowledge 24の歩き方 EYストラテジー・アンド・コンサルティング
manarobot
0
190
非同期推論システムによるコスト削減と信頼性向上
koki_nishihara
0
210
FrontDoorとWebAppsを組み合わせた際のリダイレクト処理の注意点
kenichirokimura
1
500
Databricks における 『MLOps』
databricksjapan
2
170
MLOpsの「壁」を乗り越える、LINEヤフーの Data Quality as Code
lycorptech_jp
PRO
5
460
プロトタイピングによる不確実性の低減 / Reducing Uncertainty through Prototyping
ohbarye
5
380
NgRx Signal Store
rainerhahnekamp
0
150
ChatGPT for IT Service Management (IT Pro)
dahatake
7
1.5k
最近たまに見かけるTiDBってなんだ? - Findy
pingcap0315
2
770
どうするコスト最適化のトレードオフ
tetsuyaooooo
1
500
エンジニアのキャリアをちょっと楽しくする3本の軸/Three Pillars to Make an Engineer's Career More Enjoyable
kwappa
0
2.6k
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
24
2k
Building Effective Engineering Teams - LeadDev
addyosmani
28
1.8k
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.6k
For a Future-Friendly Web
brad_frost
172
9k
Rebuilding a faster, lazier Slack
samanthasiow
73
8.2k
Atom: Resistance is Futile
akmur
259
25k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
659
120k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
2
1.3k
Designing on Purpose - Digital PM Summit 2013
jponch
110
6.5k
Thoughts on Productivity
jonyablonski
58
3.8k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
78
42k
Happy Clients
brianwarren
92
6.4k
Transcript
ANALYZE YOUR CHANGESET BEFORE GIT PUSH WITH SONARLINT + GIT
HOOKS ROUND #2 https://speakerdeck.com/janosgyerik/sonarlint-before-git-push-2
Recap
Motivation * Changeset = branch = many commits * Automatic
(+bypass)
git clone https://github.com/janosgyerik/sonarlint-git-hooks cd sonarlint-git-hooks ./get-and-setup-sonarlint.sh hooks=$PWD cd /path/to/your/project $hooks/install.sh
Setup
Difference from sonar-github * Runs locally * Fast feedback *
No-brainer setup
Difference from pre-commit checks in IntelliJ * Many commits vs
one * Less frequent * IntelliJ not needed
“custom” sonarlint? custom == future
None
Tip #1 : bypass the analysis SKIPSONARLINT=1 git push -u
origin HEAD
Tip #2 : git alias to bypass the analysis somename
= "!f() { SKIPSONARLINT=1 git push -u origin HEAD \"$@\"; }; f"
Tip #3 : enable pre-commit hook mv .git/hooks/pre-commit.optional .git/hooks/pre-commit
https://github.com/janosgyerik/sonarlint-git-hooks/issues Problems? Ideas? Feature requests?