overcommit 0.56.0 → 0.57.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/default.yml +7 -0
- data/lib/overcommit/hook/commit_msg/base.rb +1 -1
- data/lib/overcommit/hook/pre_commit/erb_lint.rb +20 -0
- data/lib/overcommit/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5c35b43073b67da5cd0f8218c5ffd914b0601f1aac6d5ac9263ec3945893259
|
4
|
+
data.tar.gz: 9c08bf2a7153993c48e3d15f30dee2c846edbb5f8500f89a41e027ec80ffb767
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cdcab7f4b31feed71b3f584f1e025a930d9b767e4e9acf00562ed57fac38442381454f57758bd967a657c9f966842f44212b53e2b482fe50613723590383d02
|
7
|
+
data.tar.gz: 6d763e1d1eca286dd9c8861ee265bd8b3ed29e740d10d430e82c461ae64b313ef2057b11db654c0f694c21dcefcf187b8e7ea27bfbf1a16eba3d6f47776b4772
|
data/config/default.yml
CHANGED
@@ -275,6 +275,13 @@ PreCommit:
|
|
275
275
|
- '**/*.ex'
|
276
276
|
- '**/*.exs'
|
277
277
|
|
278
|
+
ErbLint:
|
279
|
+
enabled: false
|
280
|
+
description: 'Analyze with ERB Lint'
|
281
|
+
required_executable: 'erblint'
|
282
|
+
install_command: 'bundle install erb_lint'
|
283
|
+
include: '**/*.html.erb'
|
284
|
+
|
278
285
|
EsLint:
|
279
286
|
enabled: false
|
280
287
|
description: 'Analyze with ESLint'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Overcommit::Hook::PreCommit
|
4
|
+
# Runs `erblint` against any modified ERB files.
|
5
|
+
#
|
6
|
+
# @see https://github.com/Shopify/erb-lint
|
7
|
+
class ErbLint < Base
|
8
|
+
MESSAGE_REGEX = /(?<message>.+)\nIn file: (?<file>.+):(?<line>\d+)/
|
9
|
+
|
10
|
+
def run
|
11
|
+
result = execute(command, args: applicable_files)
|
12
|
+
return :pass if result.success?
|
13
|
+
|
14
|
+
extract_messages(
|
15
|
+
result.stdout.split("\n\n")[1..-1],
|
16
|
+
MESSAGE_REGEX
|
17
|
+
)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/overcommit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: overcommit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.57.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane da Silva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: childprocess
|
@@ -130,6 +130,7 @@ files:
|
|
130
130
|
- lib/overcommit/hook/pre_commit/credo.rb
|
131
131
|
- lib/overcommit/hook/pre_commit/css_lint.rb
|
132
132
|
- lib/overcommit/hook/pre_commit/dogma.rb
|
133
|
+
- lib/overcommit/hook/pre_commit/erb_lint.rb
|
133
134
|
- lib/overcommit/hook/pre_commit/es_lint.rb
|
134
135
|
- lib/overcommit/hook/pre_commit/execute_permissions.rb
|
135
136
|
- lib/overcommit/hook/pre_commit/fasterer.rb
|