filmov
tv
Pre Commit Hooks EXPLAINED | Easy Way Clean Repo! GitHub & PyCharm
Показать описание
Ever found yourself in a coding conundrum with a teammate whose style is as different as night and day?
We have all been there! Fear not, because in this video I have got the perfect solution for you. Whether you are part of a software development team, organization, or company, sticking to coding standards like PEP8 is crucial.
But does not have to be hard!
In this tutorial, we discuss the pre-commit hooks – the unsung heroes of code checking!
I will show you how to set up these magic hooks to automatically run checks on your Python source code for those pesky programmatic and stylistic errors, also known as linting. These pre-commit hooks are the way to keep your code error-free and top-notch, saving you time and effort in the long run.
Not only will this setup help you stick to PEP8 and other standards, but it will also make life easier for your teammates and collaborators, making code readable, debuggable, and a whole lot more efficient for everyone involved. In addition to smaller teams, pre-commit hooks are also commonly used in big tech giants like Google, Amazon, Apple, Facebook (Meta), Microsoft, and LinkedIn to name a few.
I will briefly explain the pre-commit hooks, and then show how they work directly in the terminal with a simple example code. Finally, I will show you two great FREE tools (GitHub Desktop and PyCharm) and how they are integrated between themselves, which will make pre-commit hooks and the software development process so much more enjoyable.
We will install and configure pre-commit and the necessary plugins. By the end of this tutorial, you will be the proud owner of a fully functional pre-commit hook setup, ready to save you time and effort in your development process.
========================================
Timestamps for you to navigate in this tutorial:
01:01 Collaborative Software Hell!
01:36 Python Standards Development Standards (PEP8)
01:52 Automated Tools To Adhere to These Standards
02:16 Hands-on Tutorial
07:13 Messing Up The Code
10:30 Pre-commit Hooks To Clean The Mess
17:12 Practical Way to Easy Use of Pre-Commit Hooks
18:02 Automation Of GitHub Commits!
24:50 Quick Overview Of GitHub Desktop
27:02 Tip For Color-Blind Developers
26:49 Real-Time Pre-Commit Hooks Automation
27:23 Integration Between GitHub Desktop & PyCharm
27:47 A Few Words About PyCharm
If you want to see how pre-commit hooks modify the files in the terminal immediately, jump to 10:07 or a real-time automation at 26:49 and onwards. Otherwise, if you want to see my insights along the way starting from scratch, you are welcome to watch the whole video, of course!
========================================
Mini guide to installing and setting up the pre-commit hooks on GitHub for automated code diting:
1. pip3 install pre-commit # to install pre-commit hooks
3. pre-commit install # to run automatically on git commit
========================================
repos:
rev: v4.4.0
hooks:
- id: check-ast
# Isort automatically sorts and formats your Python imports.
rev: 5.12.0
hooks:
- id: isort
args: ["--filter-files",
# line length must match black and flake8
"--profile=black"]
# Black automatically formats your code to make it more readable and consistent.
rev: 23.3.0
hooks:
- id: black
exclude: acc_app_venv/
# flake8 checks your code against PEP8, Python's official style guide,
# # and also looks for logical errors.
rev: 6.0.0
hooks:
- id: flake8
========================================
Useful links mentioned in the video:
========================================
So, join me as we demystify these beasts - pre-commit hooks and pave the way for smoother, more enjoyable coding adventures.
Do not forget to smash that subscribe button to stay updated with more exciting tutorials.
Let us make coding great again, one commit at a time! 🌟
========================================
Ways to connect:
Subscribe!
LinkedIn
Medium
Happy debugging everyone!
========================================
Disclaimer: everything presented in this video is my own opinion and is meant to educate and share information, nothing mentioned or described here is legal or financial advice. Ruslan Brilenkov is not responsible for any profits or losses associated with your investment. So, please be responsible for your own actions.
We have all been there! Fear not, because in this video I have got the perfect solution for you. Whether you are part of a software development team, organization, or company, sticking to coding standards like PEP8 is crucial.
But does not have to be hard!
In this tutorial, we discuss the pre-commit hooks – the unsung heroes of code checking!
I will show you how to set up these magic hooks to automatically run checks on your Python source code for those pesky programmatic and stylistic errors, also known as linting. These pre-commit hooks are the way to keep your code error-free and top-notch, saving you time and effort in the long run.
Not only will this setup help you stick to PEP8 and other standards, but it will also make life easier for your teammates and collaborators, making code readable, debuggable, and a whole lot more efficient for everyone involved. In addition to smaller teams, pre-commit hooks are also commonly used in big tech giants like Google, Amazon, Apple, Facebook (Meta), Microsoft, and LinkedIn to name a few.
I will briefly explain the pre-commit hooks, and then show how they work directly in the terminal with a simple example code. Finally, I will show you two great FREE tools (GitHub Desktop and PyCharm) and how they are integrated between themselves, which will make pre-commit hooks and the software development process so much more enjoyable.
We will install and configure pre-commit and the necessary plugins. By the end of this tutorial, you will be the proud owner of a fully functional pre-commit hook setup, ready to save you time and effort in your development process.
========================================
Timestamps for you to navigate in this tutorial:
01:01 Collaborative Software Hell!
01:36 Python Standards Development Standards (PEP8)
01:52 Automated Tools To Adhere to These Standards
02:16 Hands-on Tutorial
07:13 Messing Up The Code
10:30 Pre-commit Hooks To Clean The Mess
17:12 Practical Way to Easy Use of Pre-Commit Hooks
18:02 Automation Of GitHub Commits!
24:50 Quick Overview Of GitHub Desktop
27:02 Tip For Color-Blind Developers
26:49 Real-Time Pre-Commit Hooks Automation
27:23 Integration Between GitHub Desktop & PyCharm
27:47 A Few Words About PyCharm
If you want to see how pre-commit hooks modify the files in the terminal immediately, jump to 10:07 or a real-time automation at 26:49 and onwards. Otherwise, if you want to see my insights along the way starting from scratch, you are welcome to watch the whole video, of course!
========================================
Mini guide to installing and setting up the pre-commit hooks on GitHub for automated code diting:
1. pip3 install pre-commit # to install pre-commit hooks
3. pre-commit install # to run automatically on git commit
========================================
repos:
rev: v4.4.0
hooks:
- id: check-ast
# Isort automatically sorts and formats your Python imports.
rev: 5.12.0
hooks:
- id: isort
args: ["--filter-files",
# line length must match black and flake8
"--profile=black"]
# Black automatically formats your code to make it more readable and consistent.
rev: 23.3.0
hooks:
- id: black
exclude: acc_app_venv/
# flake8 checks your code against PEP8, Python's official style guide,
# # and also looks for logical errors.
rev: 6.0.0
hooks:
- id: flake8
========================================
Useful links mentioned in the video:
========================================
So, join me as we demystify these beasts - pre-commit hooks and pave the way for smoother, more enjoyable coding adventures.
Do not forget to smash that subscribe button to stay updated with more exciting tutorials.
Let us make coding great again, one commit at a time! 🌟
========================================
Ways to connect:
Subscribe!
Medium
Happy debugging everyone!
========================================
Disclaimer: everything presented in this video is my own opinion and is meant to educate and share information, nothing mentioned or described here is legal or financial advice. Ruslan Brilenkov is not responsible for any profits or losses associated with your investment. So, please be responsible for your own actions.
Комментарии