# See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks Repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v3.2.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-yaml - id: check-toml - id: check-added-large-files - repo: local hooks: - id: tox lint name: tox-validation ... - Source: dev.to / 5 months ago
Pre-commit hooks act as the first line of defense in maintaining code quality, seamlessly integrating with linters and code formatters. They automatically execute these tools each time a developer tries to commit code to the repository, ensuring the code adheres to the project's standards. If the hooks detect issues, the commit is paused until the issues are resolved, guaranteeing that only code meeting quality... - Source: dev.to / 5 months ago
Https://pre-commit.com/ can (and probably should) be used with any editor for such things. - Source: Hacker News / 5 months ago
Pre-commit Hooks: Pre-commit is a tool that can be set up to enforce coding rules and standards before you commit your changes to your code repository. This ensures that you can't even check in (commit) code that doesn't meet your standards. This allows a code reviewer to focus on the architecture of a change while not wasting time with trivial style nitpicks. - Source: dev.to / 6 months ago
Ah, fair enough! On my team we use pre-commit[0] a lot. I guess I would define the history to be something like "has this commit ever been run through our pre-commit hooks?". If you rewrite history, you'll (usually) produce commits that have not been through pre-commit (and they've therefore dodged a lot of static checks that might catch code that wasn't working, at that point in time). That gives some manner of... - Source: Hacker News / 7 months ago
Pre-commit is a framework for managing and maintaining multi-language pre-commit hooks. It supports hooks for various programming languages. Using this framework, you only have to specify a list of hooks you want to run before every commit, and pre-commit handles the installation and execution of those hooks despite your project’s primary language. - Source: dev.to / 7 months ago
You can learn more here: pre-commit.com. - Source: dev.to / 8 months ago
Note this includes support for pre-commit. Source: 8 months ago
As a nice next step, you could also add mypy to check your type hints are consistent, and automate running all this via pre-commit hooks set up with… pre-commit. Source: 8 months ago
Pre-commit is a framework that enables the execution of configurable checks or tasks on code changes prior to committing, providing a way to enforce code quality, formatting, and other project-specific requirements, thereby reducing potential issues and maintaining code consistency. - Source: dev.to / 10 months ago
Use source control but look at the pre-commit library. It automatically performs formatting and some other checks, you can add as many as you want. https://pre-commit.com/. Source: 10 months ago
I strongly recommend that you use a linter (e.g ruff) and formatter (e.g. black) to catch these things. It makes sense to put them in at the beginning of your development process as trying to fix it up afterwards can be a pain. I use pre-commit so that they are run every time I commit to my git repo). Source: 10 months ago
I've found precommit hooks to be pretty clunky. A precommit hook failing comes at an awkward time and interrupts my train of thought for making a commit. I've also found that managing the tools and config for them is pretty annoying, either manually or with pre-commit. Source: 11 months ago
Https://pre-commit.com/ + AWS credentials, private key and detect secret hooks. Source: 11 months ago
I talk about this in more detail in my article here, but I'm a big fan of adding pre-commit into my git repositories to help out. - Source: dev.to / 12 months ago
I use vscode and I've never used IntelliJ but you can always run black from the command line or you could run all your linters/formatters/type checkers with something like pre-commit. Https://pre-commit.com/. Source: 12 months ago
Shellcheck is your friend, along with the pre-commit framework you can enforce script conformance check during every commit process. Source: 12 months ago
Ugh, my bad. https://github.com/charliermarsh/ruff, https://github.com/psf/black, and https://pre-commit.com/. I rig it up so pre-commit runs black and ruff before every commit (locally) and fwiw it's always been under 10 seconds on my machine, usually much less. And yeah, including it in CI is nice - lets me check linux & windows, for instance. Source: 12 months ago
Underrated comment, we've started using pre-commit in our pipelines so at least things like linting/formatting/testing can provide feedback before even pushing. Source: about 1 year ago
> https://direnv.net/ -- when you cd to a directory, do things like set variables. Just use dotenv instead. https://asdf-vm.com/ -- manage and use specific versions of software. Can work with direnv too! May be useful in some cases, but adds a global dependency on asdf itself. > https://pre-commit.com/ -- git hooks that I personally found easier to manage than Husky. Git hooks are disturbing and slow down and/or... - Source: Hacker News / about 1 year ago
Part of a good software team's toolbox. Others: https://direnv.net/ -- when you cd to a directory, do things like set variables. https://asdf-vm.com/ -- manage and use specific versions of software. Can work with direnv too! https://pre-commit.com/ -- git hooks that I personally found easier to manage than Husky. - Source: Hacker News / about 1 year ago
Do you know an article comparing pre-commit by Yelp to other products?
Suggest a link to a post with product alternatives.
This is an informative page about pre-commit by Yelp. You can review and discuss the product here. The primary details have not been verified within the last quarter, and they might be outdated. If you think we are missing something, please use the means on this page to comment or suggest changes. All reviews and comments are highly encouranged and appreciated as they help everyone in the community to make an informed choice. Please always be kind and objective when evaluating a product and sharing your opinion.