mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #5341 from jbampton/check-for-trailing-whitespace
feat(CI): check for trailing whitespace
This commit is contained in:
@@ -31,3 +31,12 @@ jobs:
|
||||
node-version: '12.x'
|
||||
- run: npm install -g markdownlint-cli@0.25.0
|
||||
- run: markdownlint '**/*.md'
|
||||
trailing-whitespace:
|
||||
name: 🌌 Trailing whitespace
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: 🧹 Check for trailing whitespace
|
||||
run: |
|
||||
cd test || exit
|
||||
sh ./check-for-trailing-whitespace.sh || exit 1
|
||||
|
||||
@@ -74,7 +74,7 @@ hash_slice(mrb_state *mrb, mrb_value hash)
|
||||
* hsh.except(*keys) -> a_hash
|
||||
*
|
||||
* Returns a hash excluding the given keys and their values.
|
||||
*
|
||||
*
|
||||
* h = { a: 100, b: 200, c: 300 }
|
||||
* h.except(:a) #=> {:b=>200, :c=>300}
|
||||
* h.except(:b, :c, :d) #=> {:a=>100}
|
||||
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd .. || exit
|
||||
# print first
|
||||
grep -EHInr '( +)$' ./*
|
||||
|
||||
var=$(grep -EHInr '( +)$' ./*)
|
||||
# then exit with fail if found
|
||||
if test -z "$var"; then
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user