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
34
Keyboard shortcuts
janosgyerik
0
130
Analyze your changeset in a branch before git push using SonarLint + Git hooks
janosgyerik
0
320
Unwatch GitHub repos
janosgyerik
0
280
Code Reviews
janosgyerik
0
140
Playing with Yahoo! Pipes
janosgyerik
0
230
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
強いチームと開発生産性
onk
PRO
33
11k
【Startup CTO of the Year 2024 / Audience Award】アセンド取締役CTO 丹羽健
niwatakeru
0
930
iOSチームとAndroidチームでブランチ運用が違ったので整理してます
sansantech
PRO
0
130
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
430
社内で最大の技術的負債のリファクタリングに取り組んだお話し
kidooonn
1
550
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
5
590
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
120
複雑なState管理からの脱却
sansantech
PRO
1
140
AWS Lambdaと歩んだ“サーバーレス”と今後 #lambda_10years
yoshidashingo
1
170
The Role of Developer Relations in AI Product Success.
giftojabu1
0
120
AGIについてChatGPTに聞いてみた
blueb
0
130
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
We Have a Design System, Now What?
morganepeng
50
7.2k
Designing Experiences People Love
moore
138
23k
The Invisible Side of Design
smashingmag
298
50k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
BBQ
matthewcrist
85
9.3k
Gamification - CAS2011
davidbonilla
80
5k
Typedesign – Prime Four
hannesfritz
40
2.4k
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?