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
0
640
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
38
Keyboard shortcuts
janosgyerik
0
140
Analyze your changeset in a branch before git push using SonarLint + Git hooks
janosgyerik
0
340
Unwatch GitHub repos
janosgyerik
0
300
Code Reviews
janosgyerik
0
150
Playing with Yahoo! Pipes
janosgyerik
0
250
Cool features of GitHub
janosgyerik
0
1.3k
Time-saving tricks on the command line
janosgyerik
1
4.2k
Other Decks in Technology
See All in Technology
UIテスト自動化サポート- Testbed for XCUIAutomation practice
notoroid
0
130
Windows 11 で AWS Documentation MCP Server 接続実践/practical-aws-documentation-mcp-server-connection-on-windows-11
emiki
0
920
Observability infrastructure behind the trillion-messages scale Kafka platform
lycorptech_jp
PRO
0
140
_第3回__AIxIoTビジネス共創ラボ紹介資料_20250617.pdf
iotcomjpadmin
0
150
25分で解説する「最小権限の原則」を実現するための AWS「ポリシー」大全 / 20250625-aws-summit-aws-policy
opelab
9
1.1k
BigQuery Remote FunctionでLooker Studioをインタラクティブ化
cuebic9bic
3
260
GitHub Copilot の概要
tomokusaba
1
130
Witchcraft for Memory
pocke
1
220
CSS、JSをHTMLテンプレートにまとめるフロントエンド戦略
d120145
0
280
Observability в PHP без боли. Олег Мифле, тимлид Altenar
lamodatech
0
330
ハノーバーメッセ2025座談会.pdf
iotcomjpadmin
0
160
Node-REDのFunctionノードでMCPサーバーの実装を試してみた / Node-RED × MCP 勉強会 vol.1
you
PRO
0
110
Featured
See All Featured
Scaling GitHub
holman
459
140k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
490
Optimising Largest Contentful Paint
csswizardry
37
3.3k
Site-Speed That Sticks
csswizardry
10
660
Building Flexible Design Systems
yeseniaperezcruz
328
39k
GraphQLとの向き合い方2022年版
quramy
47
14k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
The World Runs on Bad Software
bkeepers
PRO
69
11k
Mobile First: as difficult as doing things right
swwweet
223
9.7k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
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?