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
630
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
37
Keyboard shortcuts
janosgyerik
0
130
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
持続可能なドキュメント運用のリアル: 1年間の成果とこれから
akitok_
1
130
Goの組織でバックエンドTypeScriptを採用してどうだったか / How was adopting backend TypeScript in a Golang company
kaminashi
6
5.8k
システムとの会話から生まれる先手のDevOps
kakehashi
PRO
0
280
LLM as プロダクト開発のパワードスーツ
layerx
PRO
1
240
地味にいろいろあった! 2025春のAmazon Bedrockアップデートおさらい
minorun365
PRO
1
120
4/17/25 - CIJUG - Java Meets AI: Build LLM-Powered Apps with LangChain4j (part 2)
edeandrea
PRO
0
110
The Tale of Leo: Brave Lion and Curious Little Bug
canalun
1
120
彩の国で始めよう。おっさんエンジニアから共有したい、当たり前のことを当たり前にする技術
otsuki
0
150
ドキュメント管理の理想と現実
kazuhe
0
140
[2025年4月版] Databricks Academy ラボ環境 利用開始手順 / Databricks Academy Labs Onboarding
databricksjapan
0
140
Classmethod AI Talks(CATs) #21 司会進行スライド(2025.04.17) / classmethod-ai-talks-aka-cats_moderator-slides_vol21_2025-04-17
shinyaa31
0
590
Porting PicoRuby to Another Microcontroller: ESP32
yuuu
4
410
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
30k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.8k
Designing Experiences People Love
moore
141
24k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
5
550
Documentation Writing (for coders)
carmenintech
69
4.7k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Scaling GitHub
holman
459
140k
Docker and Python
trallard
44
3.3k
Speed Design
sergeychernyshev
29
900
Side Projects
sachag
452
42k
Six Lessons from altMBA
skipperchong
27
3.7k
Become a Pro
speakerdeck
PRO
27
5.3k
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?