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
620
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
35
Keyboard shortcuts
janosgyerik
0
130
Analyze your changeset in a branch before git push using SonarLint + Git hooks
janosgyerik
0
330
Unwatch GitHub repos
janosgyerik
0
290
Code Reviews
janosgyerik
0
140
Playing with Yahoo! Pipes
janosgyerik
0
240
Cool features of GitHub
janosgyerik
0
1.3k
Time-saving tricks on the command line
janosgyerik
1
4.1k
Other Decks in Technology
See All in Technology
【NGK2025S】動物園(PINTO_model_zoo)に遊びに行こう
kazuhitotakahashi
0
210
実践! ソフトウェアエンジニアリングの価値の計測 ── Effort、Output、Outcome、Impact
nomuson
0
2k
EMConf JP の楽しみ方 / How to enjoy EMConf JP
pauli
2
150
Reactフレームワークプロダクトを モバイルアプリにして、もっと便利に。 ユーザに価値を届けよう。/React Framework with Capacitor
rdlabo
0
110
Cloudflareで実現する AIエージェント ワークフロー基盤
kmd09
0
280
iPadOS18でフローティングタブバーを解除してみた
sansantech
PRO
1
130
シフトライトなテスト活動を適切に行うことで、無理な開発をせず、過剰にテストせず、顧客をビックリさせないプロダクトを作り上げているお話 #RSGT2025 / Shift Right
nihonbuson
3
2.1k
新しいスケーリング則と学習理論
taiji_suzuki
10
3.8k
機械学習を「社会実装」するということ 2025年版 / Social Implementation of Machine Learning 2025 Version
moepy_stats
4
880
My small contributions - Fujiwara Tech Conference 2025
ijin
0
1.4k
I could be Wrong!! - Learning from Agile Experts
kawaguti
PRO
8
3.3k
SpiderPlus & Co. エンジニア向け会社紹介資料
spiderplus_cb
0
860
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
The World Runs on Bad Software
bkeepers
PRO
66
11k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Why Our Code Smells
bkeepers
PRO
335
57k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
What's in a price? How to price your products and services
michaelherold
244
12k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
GraphQLとの向き合い方2022年版
quramy
44
13k
Code Review Best Practice
trishagee
65
17k
Building Applications with DynamoDB
mza
93
6.2k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
49
2.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?