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
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
社外コミュニティで学び社内に活かす共に学ぶプロジェクトの実践/backlogworld2024
nishiuma
0
250
成果を出しながら成長する、アウトプット駆動のキャッチアップ術 / Output-driven catch-up techniques to grow while producing results
aiandrox
0
180
AI時代のデータセンターネットワーク
lycorptech_jp
PRO
1
280
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
140
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
110
ハイテク休憩
sat
PRO
2
120
Wvlet: A New Flow-Style Query Language For Functional Data Modeling and Interactive Data Analysis - Trino Summit 2024
xerial
1
110
サイバー攻撃を想定したセキュリティガイドライン 策定とASM及びCNAPPの活用方法
syoshie
3
1.2k
UI State設計とテスト方針
rmakiyama
2
300
Oracle Cloudの生成AIサービスって実際どこまで使えるの? エンジニア目線で試してみた
minorun365
PRO
4
270
10分で学ぶKubernetesコンテナセキュリティ/10min-k8s-container-sec
mochizuki875
3
320
なぜCodeceptJSを選んだか
goataka
0
150
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
We Have a Design System, Now What?
morganepeng
51
7.3k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Gamification - CAS2011
davidbonilla
80
5.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
YesSQL, Process and Tooling at Scale
rocio
169
14k
How GitHub (no longer) Works
holman
311
140k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
95
17k
What's in a price? How to price your products and services
michaelherold
243
12k
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?