lhj-tools 0.2.17 → 0.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/lhj/helper/traditional_check_helper.rb +7 -4
- data/lib/lhj/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 509f99b0016a2e707beb579db1816a7ec18f3b33cddd94e19a57b2c15647263a
|
|
4
|
+
data.tar.gz: b517dbf9804e590642a0ee5f5573afe96e5549cd36ca2aa2fef9e3a049f957e8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c6be2007a5aebf3a17e3a3e3a01f17a16f49815d79b815d03da680cda6b9f56bff3f1ff22431bd4a8c4643346607119b816424774b2150c87d1553d8b5e4c5a2
|
|
7
|
+
data.tar.gz: e6057d8bf34a3ab6c2aa1e8040dd7705c49e69a6b7b19f5ca9a9e38b4bb7e8b4b75875f09b75e28d7fdc8ff74b804338b35ad2a3f7a9609f576bd2b0b7057531
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
module Lhj
|
|
2
2
|
class TraditionalCheckHelper
|
|
3
|
-
def self.check(path, ignore_path, type = 'm,h,pch
|
|
3
|
+
def self.check(path, ignore_path, type = 'm,h,pch')
|
|
4
4
|
ignore_file = File.join(ignore_path, '.checkignore')
|
|
5
5
|
ignore_list = []
|
|
6
6
|
ignore_list = File.readlines(ignore_file).map { |f| f.gsub(/\n/, '') } if File.exist?(ignore_file)
|
|
7
7
|
check_ignore(path, type: type, ignore: ignore_list)
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
def self.check_ignore(path, type: 'm,h,pch
|
|
10
|
+
def self.check_ignore(path, type: 'm,h,pch', ignore: [])
|
|
11
11
|
result = {}
|
|
12
12
|
all_files = Dir.glob("#{path}/**/*.{#{type}}").reject do |p|
|
|
13
13
|
p =~ /Pods/ || ignore.include?(File.basename(p))
|
|
@@ -18,7 +18,7 @@ module Lhj
|
|
|
18
18
|
|
|
19
19
|
result[File.basename(f)] = infos
|
|
20
20
|
end
|
|
21
|
-
|
|
21
|
+
result.keys.each_slice(10) { |a| notify(result.slice(*a)) }
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
def self.show_result(result)
|
|
@@ -37,6 +37,9 @@ module Lhj
|
|
|
37
37
|
File.open(file, 'r') do |f|
|
|
38
38
|
f.readlines.each_with_index do |line, idx|
|
|
39
39
|
next if line =~ %r{//}
|
|
40
|
+
next if line =~ /#/
|
|
41
|
+
next if line.strip =~ /^\*/
|
|
42
|
+
next if line =~ /log|Log|LOG/
|
|
40
43
|
next unless line =~ /[\u4e00-\u9fa5]/
|
|
41
44
|
next unless Lhj::Trans::Helper.instance.contain_zh_hk(line)
|
|
42
45
|
|
|
@@ -54,7 +57,7 @@ module Lhj
|
|
|
54
57
|
temp = Lhj::ErbTemplateHelper.load('traditional_code_notify')
|
|
55
58
|
temp_result = Lhj::ErbTemplateHelper.render(temp, { result: result }, '-')
|
|
56
59
|
puts temp_result
|
|
57
|
-
Lhj::Dingtalk.
|
|
60
|
+
Lhj::Dingtalk.post_message_robot(robot_url, 'check code', temp_result)
|
|
58
61
|
end
|
|
59
62
|
|
|
60
63
|
end
|
data/lib/lhj/version.rb
CHANGED