codeowners-checker 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b2ab2f62e2427574e64399dc1a1f3681aafc9280af254f04214f1b9be7d50944
4
- data.tar.gz: 562d0c9c43d6f49694820b25ed7b47ad7474f72ba097b98dcd4c1292cacdc62e
3
+ metadata.gz: 4e2f46c087d367f8963223d632e6231db0b4b010595fba6190dc362b06846af6
4
+ data.tar.gz: 48aecfde1e7f978742558e66752f05e6b452b565f04a43a0a951caf4c431d333
5
5
  SHA512:
6
- metadata.gz: 2c0cac23ce8db93e59db7466709a33a90acd43e8168d1ddc22ad57ba1ceff569df2c4d14bc43b71d2fd08a476c182fc467837862c630315db6eeffce9b11c5ab
7
- data.tar.gz: a4541d789b24f3baf6adae817bde3d1fd04cf49e2c26e0fea177067c4186a2724b31515ec3811e58286624a83e9f7b1adfd05cb964a6fd9b3170f5f1c0e4f36f
6
+ metadata.gz: 154979b0d6a14f51fd914bcf6a2422e83e90ecf9c2afb3dfe19c476bfe0868ea1018fa6c8e53b0ee99342e8cbc7837bef2153fe8aa9f0385ef177600fd630719
7
+ data.tar.gz: 15fef3967b0859b85a6c053b1cd8dfcea829e02f2cdcc701c26906e3fea03b9e8c3823cfa63691cb4cfe7b0fb9d5b76070bd4698f38ceba86a15a5f3c12efd66
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![CircleCI](https://circleci.com/gh/toptal/codeowners-checker.svg?style=svg)](https://circleci.com/gh/toptal/codeowners-checker)
2
+
1
3
  # Codeowners Checker
2
4
 
3
5
  This gem checks if the GitHub codeowners are specified to all files changes
@@ -28,6 +28,7 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency 'rake', '~> 10.0'
29
29
  spec.add_development_dependency 'rb-readline', '~> 0.5.5'
30
30
  spec.add_development_dependency 'rspec', '~> 3.0'
31
+ spec.add_development_dependency 'rspec_junit_formatter', '~> 0.4.1'
31
32
  spec.add_development_dependency 'rubocop', '~> 0.61.1'
32
33
  spec.add_development_dependency 'rubocop-rspec', '~> 1.30'
33
34
  spec.add_development_dependency 'simplecov', '~> 0.16.1'
@@ -38,7 +38,8 @@ module Codeowners
38
38
  private
39
39
 
40
40
  def list
41
- @list ||= @file_manager.content.yield_self do |list|
41
+ @list ||= begin
42
+ list = @file_manager.content
42
43
  transform_line_procs.each do |transform_line_proc|
43
44
  list = list.flat_map { |line| transform_line_proc.call(line) }.compact
44
45
  end
@@ -108,7 +108,7 @@ module Codeowners
108
108
 
109
109
  def remove(line)
110
110
  @list.safe_delete(line)
111
- remove! unless any?(Pattern)
111
+ remove! unless any? { |object| object.is_a? Pattern }
112
112
  end
113
113
 
114
114
  def remove!
@@ -9,7 +9,7 @@ module Codeowners
9
9
  # of a group.
10
10
  class GroupBeginComment < Comment
11
11
  def self.match?(line)
12
- line.lstrip.start_with?(/^#+ BEGIN/)
12
+ line.lstrip =~ /^#+ BEGIN/
13
13
  end
14
14
  end
15
15
  end
@@ -9,7 +9,7 @@ module Codeowners
9
9
  # of a group.
10
10
  class GroupEndComment < Comment
11
11
  def self.match?(line)
12
- line.lstrip.start_with?(/^#+ END/)
12
+ line.lstrip =~ /^#+ END/
13
13
  end
14
14
  end
15
15
  end
@@ -33,10 +33,14 @@ module Codeowners
33
33
  end
34
34
 
35
35
  def match_file?(file)
36
- if !pattern.include?('/') || pattern.include?('**')
37
- File.fnmatch(pattern.gsub(%r{^/}, ''), file, File::FNM_DOTMATCH)
36
+ File.fnmatch(pattern.gsub(%r{^/}, ''), file, fn_options)
37
+ end
38
+
39
+ def fn_options
40
+ if pattern.include?('**')
41
+ File::FNM_DOTMATCH
38
42
  else
39
- File.fnmatch(pattern.gsub(%r{^/}, ''), file, File::FNM_PATHNAME | File::FNM_DOTMATCH)
43
+ File::FNM_DOTMATCH | File::FNM_PATHNAME
40
44
  end
41
45
  end
42
46
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Codeowners
4
4
  class Checker
5
- VERSION = '1.0.3'
5
+ VERSION = '1.0.4'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeowners-checker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jônatas Davi Paganini
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-07-17 00:00:00.000000000 Z
13
+ date: 2019-09-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: fuzzy_match
@@ -124,6 +124,20 @@ dependencies:
124
124
  - - "~>"
125
125
  - !ruby/object:Gem::Version
126
126
  version: '3.0'
127
+ - !ruby/object:Gem::Dependency
128
+ name: rspec_junit_formatter
129
+ requirement: !ruby/object:Gem::Requirement
130
+ requirements:
131
+ - - "~>"
132
+ - !ruby/object:Gem::Version
133
+ version: 0.4.1
134
+ type: :development
135
+ prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ requirements:
138
+ - - "~>"
139
+ - !ruby/object:Gem::Version
140
+ version: 0.4.1
127
141
  - !ruby/object:Gem::Dependency
128
142
  name: rubocop
129
143
  requirement: !ruby/object:Gem::Requirement