feat: add pre-commit framework
ADD
.pre-commit-config.yaml
+---
+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]

MODIFY
CONTRIBUTING.md
CONTRIBUTING.md
@@ -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.

MODIFY
LEGAL
LEGAL
@@ -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:
-

MODIFY
LICENSE
LICENSE
@@ -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.
-

MODIFY
NEWS
NEWS
@@ -9,5 +9,3 @@ with all sufficient information, see the ChangeLog file.
** Information about first release v1.0.0
-
-

MODIFY
mrbgems/mruby-bin-debugger/tools/mrdb/mrdberror.h
mrbgems/mruby-bin-debugger/tools/mrdb/mrdberror.h
#define MRB_DEBUG_BREAK_NO_OVER (-15)
#endif
-

MODIFY
mrbgems/mruby-compiler/core/lex.def
mrbgems/mruby-compiler/core/lex.def
@@ -205,4 +205,3 @@ mrb_reserved_word (register const char *str, register size_t len)
return 0;
}
#line 52 "mrbgems/mruby-compiler/core/keywords"
-

MODIFY
mrbgems/mruby-sleep/example/sleep.rb
mrbgems/mruby-sleep/example/sleep.rb
sleep(10)
usleep(10000)
-

MODIFY
mrbgems/mruby-toplevel-ext/test/toplevel.rb
mrbgems/mruby-toplevel-ext/test/toplevel.rb
@@ -21,4 +21,3 @@ assert('Toplevel#include') do
assert_equal :foo, method_foo
assert_equal :bar2, CONST_BAR
end
-

MODIFY
test/t/basicobject.rb
test/t/basicobject.rb
@@ -8,4 +8,3 @@ end
assert('BasicObject superclass') do
assert_nil(BasicObject.superclass)
end
-

MODIFY
test/t/object.rb
test/t/object.rb
@@ -8,4 +8,3 @@ end
assert('Object superclass', '15.2.1.2') do
assert_equal BasicObject, Object.superclass
end
-

feat: add pre-commit framework