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 p...
Search
Janos Gyerik
December 08, 2016
Technology
650
0
Share
Analyze your changeset in a branch before git push using SonarLint + Git hooks; Round #2
Janos Gyerik
December 08, 2016
More Decks by Janos Gyerik
See All by Janos Gyerik
Capture The Flag at SonarSource 2019
janosgyerik
1
44
Keyboard shortcuts
janosgyerik
0
140
Analyze your changeset in a branch before git push using SonarLint + Git hooks
janosgyerik
0
370
Unwatch GitHub repos
janosgyerik
0
320
Code Reviews
janosgyerik
0
150
Playing with Yahoo! Pipes
janosgyerik
0
260
Cool features of GitHub
janosgyerik
0
1.3k
Time-saving tricks on the command line
janosgyerik
1
4.3k
Other Decks in Technology
See All in Technology
Why we keep our community?
kawaguti
PRO
0
360
Move Fast and Break Things: 10 in 20
ramimac
0
110
Amazon Qはアマコネで頑張っています〜 Amazon Q in Connectについて〜
yama3133
1
170
スケーリングを封じられたEC2を救いたい
senseofunity129
0
130
マルチモーダル非構造データとの闘い
shibuiwilliam
1
130
AI時代のシステム開発者の仕事_20260328
sengtor
0
320
出版記念イベントin大阪「書籍紹介&私がよく使うMCPサーバー3選と社内で安全に活用する方法」
kintotechdev
0
130
AWSで2番目にリリースされたサービスについてお話しします(諸説あります)
yama3133
0
110
来期の評価で変えようと思っていること 〜AI時代に変わること・変わらないこと〜
estie
0
130
Zephyr(RTOS)でARMとRISC-Vのコア間通信をしてみた
iotengineer22
0
120
やさしいとこから始めるGitHubリポジトリのセキュリティ
tsubakimoto_s
3
2.1k
Oracle Cloud Infrastructure:2026年3月度サービス・アップデート
oracle4engineer
PRO
0
300
Featured
See All Featured
Balancing Empowerment & Direction
lara
5
1k
Technical Leadership for Architectural Decision Making
baasie
3
300
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
470
Building a Scalable Design System with Sketch
lauravandoore
463
34k
エンジニアに許された特別な時間の終わり
watany
106
240k
Six Lessons from altMBA
skipperchong
29
4.2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.1k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
490
How GitHub (no longer) Works
holman
316
150k
Producing Creativity
orderedlist
PRO
348
40k
Embracing the Ebb and Flow
colly
88
5k
WCS-LA-2024
lcolladotor
0
510
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?