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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Janos Gyerik
December 08, 2016
Technology
0
650
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
44
Keyboard shortcuts
janosgyerik
0
140
Analyze your changeset in a branch before git push using SonarLint + Git hooks
janosgyerik
0
360
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
量子クラウドサービスの裏側 〜Deep Dive into OQTOPUS〜
oqtopus
0
150
今こそ学びたいKubernetesネットワーク ~CNIが繋ぐNWとプラットフォームの「フラッと」な対話
logica0419
5
460
~Everything as Codeを諦めない~ 後からCDK
mu7889yoon
3
510
AWS DevOps Agent x ECS on Fargate検証 / AWS DevOps Agent x ECS on Fargate
kinunori
2
170
Webhook best practices for rock solid and resilient deployments
glaforge
2
310
Agile Leadership Summit Keynote 2026
m_seki
1
670
こんなところでも(地味に)活躍するImage Modeさんを知ってるかい?- Image Mode for OpenShift -
tsukaman
1
170
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
510
インフラエンジニア必見!Kubernetesを用いたクラウドネイティブ設計ポイント大全
daitak
1
390
AIと新時代を切り拓く。これからのSREとメルカリIBISの挑戦
0gm
2
3.2k
We Built for Predictability; The Workloads Didn’t Care
stahnma
0
150
AIエージェントを開発しよう!-AgentCore活用の勘所-
yukiogawa
0
190
Featured
See All Featured
The Curious Case for Waylosing
cassininazir
0
240
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
Chasing Engaging Ingredients in Design
codingconduct
0
110
Paper Plane
katiecoart
PRO
0
46k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
99
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.1k
Marketing to machines
jonoalderson
1
4.6k
The Language of Interfaces
destraynor
162
26k
Designing Powerful Visuals for Engaging Learning
tmiket
0
240
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
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?