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
600
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
32
Keyboard shortcuts
janosgyerik
0
130
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
140
Playing with Yahoo! Pipes
janosgyerik
0
230
Cool features of GitHub
janosgyerik
0
1.3k
Time-saving tricks on the command line
janosgyerik
1
4k
Other Decks in Technology
See All in Technology
年間一億円削減した時系列データベースのアーキテクチャ改善~不確実性の高いプロジェクトへの挑戦~
lycorptech_jp
PRO
3
2.9k
MySQLのロックの種類とその競合
yoku0825
6
1.6k
AWSサービスメニュー開発をしていてAWSを好きだ!と感じた瞬間
toru_kubota
0
130
地理情報とAPIのトレンド
nagix
0
160
データベース研修 DB基礎【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
220
ギークの理想が7つ集まるエムスリーで夢を叶えよう - エムスリー株式会社
m3_engineering
1
260
What is DRE? - Road to SRE NEXT@広島
chanyou0311
3
630
Luupの開発組織におけるインシデントマネジメントの変遷 ver.RoadtoSRENEXT2024
grimoh
1
270
JBUG岡山 #6 WordCamp男木島の チームビルディング
takeshifurusato
0
150
累計ダウンロード数1億8000万を超えるアプリケーションプラットフォームのレガシーシステム脱却とモダン化への道
kmitsuhashi
0
120
[I/O Extended Android 2024] What`s new in Android 2024
kyeongwan
0
220
エンジニア向け会社紹介資料
caddi_eng
14
230k
Featured
See All Featured
Creatively Recalculating Your Daily Design Routine
revolveconf
214
11k
Unsuck your backbone
ammeep
666
57k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
78
15k
GitHub's CSS Performance
jonrohan
1026
450k
StorybookのUI Testing Handbookを読んだ
zakiyama
15
4.9k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
24
1.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
39
47k
Mobile First: as difficult as doing things right
swwweet
219
8.8k
Building Applications with DynamoDB
mza
89
5.8k
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
Fashionably flexible responsive web design (full day workshop)
malarkey
399
65k
10 Git Anti Patterns You Should be Aware of
lemiorhan
652
58k
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?