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
300
Unwatch GitHub repos
janosgyerik
0
280
Code Reviews
janosgyerik
0
130
Playing with Yahoo! Pipes
janosgyerik
0
220
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
One engineer company with Ruby on Rails
rstankov
2
440
Babylon.jsと色々なものを組み合わせる:ブラウザのAPIやガジェットや2D描画ライブラリなど / Babylon.js 勉強会 vol.3
you
PRO
0
170
中年男性がメインフレームから クラウドへキャリアシフトしてみた
uechishingo
0
200
VSCodeの拡張機能を作っている話
ebarakazuhiro
1
810
IaCジェネレーターとBedrockで詳細設計書を生成してみた
tsukasa_ishimaru
4
890
「スニダン」開発組織の構造に込めた意図 ~組織作りはパッションや政治ではない!~
rinchsan
4
620
LayerXにおけるLLMプロダクト開発の今までとこれから
layerx
PRO
4
740
地理空間データ可視化・解析・活用ソリューション Pacific Spatial Solutions (PSS)
pacificspatialsolutions
0
340
アクセス制御にまつわる改善 / Improving access control
itkq
0
590
Microsoft for Startups Founders Hub_20240429 update
daikikanemitsu
1
2.4k
R3のコードから見る実践LINQ実装最適化・コンカレントプログラミング実例
neuecc
3
2.7k
ワールドカフェI /チューターを改良する / World Café I and Improving the Tutors
ks91
PRO
0
150
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
11
1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
245
20k
Typedesign – Prime Four
hannesfritz
36
2.1k
We Have a Design System, Now What?
morganepeng
43
6.8k
How STYLIGHT went responsive
nonsquared
92
4.8k
How to name files
jennybc
65
93k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
21
1.9k
Fireside Chat
paigeccino
22
2.6k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
323
20k
Git: the NoSQL Database
bkeepers
PRO
423
63k
Agile that works and the tools we love
rasmusluckow
325
20k
Designing the Hi-DPI Web
ddemaree
276
33k
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?