feat: add pre-commit framework

This commit is contained in:
John Bampton
2021-03-01 10:06:17 +10:00
parent 65add8c650
commit 1c9b1bfeb7
12 changed files with 49 additions and 11 deletions
+39
View File
@@ -0,0 +1,39 @@
---
default_stages: [commit, push]
default_language_version:
# force all unspecified Python hooks to run python3
python: python3
minimum_pre_commit_version: "1.20.0"
repos:
- repo: meta
hooks:
- id: identity
- id: check-hooks-apply
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-merge-conflict
- id: check-yaml
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
# - repo: git://github.com/Lucas-C/pre-commit-hooks
# rev: v1.1.9
# hooks:
# - id: forbid-tabs
# - id: remove-tabs
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.26.0
hooks:
- id: markdownlint
name: Run markdownlint
- repo: https://github.com/adrienverge/yamllint
rev: v1.26.0
hooks:
- id: yamllint
name: Check YAML files with yamllint
entry: yamllint --strict .
types: [yaml]
+9
View File
@@ -18,6 +18,15 @@ things in mind before submitting your pull request:
* Use mrbgem to provide non ISO features (classes, modules and methods) unless
you have a special reason to implement them in the core
## Pre-commit
A framework for managing and maintaining multi-language pre-commit hooks.
Pre-commit can be [installed](https://pre-commit.com/#installation) with `pip`, `curl`, `brew` or `conda`.
You need to first install pre-commit and then install the pre-commit hooks with `pre-commit install`.
Now pre-commit will run automatically on git commit!
It's usually a good idea to run the hooks against all the files when adding new hooks (usually pre-commit will only run on the changed files during git hooks).
Use `pre-commit run --all-files` to check all files.
## Coding conventions
How to style your C and Ruby code which you want to submit.
-1
View File
@@ -3,4 +3,3 @@ LEGAL NOTICE INFORMATION
All the files in this distribution are covered under the MIT license
(see the file LICENSE) except some files mentioned below:
-1
View File
@@ -17,4 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
-2
View File
@@ -9,5 +9,3 @@ with all sufficient information, see the ChangeLog file.
** Information about first release v1.0.0
@@ -17,4 +17,3 @@
#define MRB_DEBUG_BREAK_NO_OVER (-15)
#endif
-1
View File
@@ -205,4 +205,3 @@ mrb_reserved_word (register const char *str, register size_t len)
return 0;
}
#line 52 "mrbgems/mruby-compiler/core/keywords"
-1
View File
@@ -1,3 +1,2 @@
sleep(10)
usleep(10000)
@@ -21,4 +21,3 @@ assert('Toplevel#include') do
assert_equal :foo, method_foo
assert_equal :bar2, CONST_BAR
end
-1
View File
@@ -8,4 +8,3 @@ end
assert('BasicObject superclass') do
assert_nil(BasicObject.superclass)
end
+1 -1
View File
@@ -58,4 +58,4 @@ assert('next expression', '11.5.2.4.4') do
end
all
end
end
end
-1
View File
@@ -8,4 +8,3 @@ end
assert('Object superclass', '15.2.1.2') do
assert_equal BasicObject, Object.superclass
end