按照操作将会在项目的.git/hooks下生成一个pre-commit文件(覆盖原pre-commit文件),该hook会根据项目根目录下的.pre-commit-config.yaml执行任务。 配置pre-commit 其实就是修改项目根目录下的.pre-commit-config.yaml文件,可选配置项如: 样例配置文件 demo配置 pre-commit-config
151d5e4·May 16, 2025 History 32 Commits .pre-commit-config.yaml fix(line-length): set line length limit to 120 char on ruff-format May 14, 2025 LICENSE Initial commit Feb 7, 2024 MIT License Copyright (c) 2024 Docsumo Permission is hereby granted, free of charge, to any person obta...
repos:-repo:https://github.com/pre-commit/pre-commit-hooksrev:v1.2.3hooks:-... .pre-commit-config.yaml - hooks The hook mapping configures which hook from the repository is used and allows for customization. All optional keys will receive their default from the repository's configuration. O...
2. An error has occurred: InvalidConfigError: ===> .pre-commit-config.yaml is not a file Check the log at /root/.cache/pre-commit/pre-commit.log or No .pre-commit-config.yaml file was found - To temporarily silence this, run `PRE_COMMIT_ALLOW_NO_CONFIG=1 git ...` - To permane...
按照操作将会在项目的.git/hooks下生成一个pre-commit文件(覆盖原pre-commit文件),该hook会根据项目根目录下的.pre-commit-config.yaml 执行任务。如果vim .git/hooks/pre-commit可以看到代码的实现,基本逻辑是利用pre-commit文件去拓展更多的pre-commit,这个和我上一篇文章的逻辑是类似的。 安装/卸载其他阶段的hoo...
写.pre-commit-config.yaml 配置文件 用pre-commit install 安装git hooks到你的 .git/ 目录 我们的 .pre-commit-config.yaml 很简单,如下: repos: - repo: github.com/ambv/black rev: stable hooks: - id: black language_version: python3.7 - repo: github.com/pre-commit/p rev: v1.2.3 hooks...
在MMYOLO 的根目录里面有 .pre-commit-config.yaml 文件,在其中设置和约束了 MMYOLO 的代码规范。 exclude: ^tests/data/ repos: - repo: https://github.com/PyCQA/flake8 rev: 3.8.3 hooks: - id: flake8 - repo: https://github.com/PyCQA/isort rev: 5.10.1 hooks: - id: isort - repo: ...
"devDependencies": {"axios":"^0.21.0","babel-eslint":"^10.1.0","cross-env":"^7.0.2","eslint":"^7.14.0","eslint-config-airbnb":"^18.2.1","eslint-plugin-import":"^2.22.1","eslint-plugin-jsx-a11y":"^6.4.1","nodemon":"^1.19.1","pre-commit":"^1.2.2"},"pre-commit...
Add this to your .pre-commit-config.yaml - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 # Use the ref you want to point at hooks: - id: trailing-whitespace # - id: ... Hooks available check-added-large-files Prevent giant files from being committed. Specify ...
为什么用pre-commit 加 tslint(jshint,eslint原理都类似),因为在项目中我们会经常忘记主动的去做代码检查,虽然结合webpack各种构建工具下,存在*slint报错,项目会跑不起来。但在某些情况下,可能会因为着急,或者其他原因,没有去观察项目运行的情况就仓促提交。团队开发的情景下,可能会成为别人的麻烦。而pre-commit tsl...