quality 23.0.4 → 23.0.5

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
  SHA1:
3
- metadata.gz: 3db3bca891e502c46d1cf10d80c3a546af59517f
4
- data.tar.gz: 530bc031368e937405fa8f664bbd6a25d940245a
3
+ metadata.gz: 732e0610b537876b8c8b74dfc803953d8d120dde
4
+ data.tar.gz: 376e9210a56020a21858619014e464182cda8ded
5
5
  SHA512:
6
- metadata.gz: 691beebe44c0dee59d44abe873bc5c3701666b32d64886c1227365f3055359301ba94d50e6e8479d83f7c867a44ed82e4737cd862b0fce77bc79f65d61ba98c3
7
- data.tar.gz: 0cdc71d955b6397494f8d91476d4b86fc70bfe68ba9f882d9a1214793af64b79b9b50626899b76f07d6d5795c3b10defb681ebc5258bcd78078aff4c10b3781f
6
+ metadata.gz: 7ae72fdd804d9c7ba776c9c5163998f76aa43ba26fe7473ece5906965735cd5da963c7fbe8a6a8b9ce3cc61dd2f6d01b682aedd0ee54fc6314188b5a1fcfee6c
7
+ data.tar.gz: 7896609e60a8934ea4f43256b64f0f1e42a998aa7e6ba72cf0098f2ffc6f0657fc524df34279d5d8c373b25c3937d27e101ce891b9eb15e102cd3558736c4921
@@ -11,12 +11,13 @@ module Quality
11
11
  attr_accessor :skip_tools, :verbose, :quality_name, :ratchet_name,
12
12
  :output_dir, :punchlist_regexp
13
13
 
14
- attr_writer :source_files_exclude_glob, :exclude_files
14
+ attr_writer :source_files_exclude_glob
15
15
 
16
16
  extend Forwardable
17
17
 
18
18
  def_delegators(:@source_file_globber, :ruby_files, :python_files,
19
- :js_files, :source_and_doc_files, :source_files)
19
+ :js_files, :source_and_doc_files, :source_files,
20
+ :exclude_files=, :exclude_files)
20
21
 
21
22
  def to_glob(files)
22
23
  "{#{files.join(',')}}"
@@ -30,10 +31,6 @@ module Quality
30
31
  to_glob(source_and_doc_files)
31
32
  end
32
33
 
33
- def exclude_files
34
- @exclude_files || []
35
- end
36
-
37
34
  def source_files_exclude_glob
38
35
  @source_files_exclude_glob || to_glob(exclude_files)
39
36
  end
@@ -17,16 +17,17 @@ module Quality
17
17
  @project = project
18
18
  @breakdown_by_file = @project.breakdown_by_file
19
19
  @file_blob = file_blob
20
+ @exclude_files = nil
20
21
  @pwd = pwd
21
22
  end
22
23
 
23
24
  def submodule_or_symlink?(file)
24
25
  # Skip submodules and symlinks
25
26
  mode = file[:filemode]
26
- mode_format = (mode & 0170000)
27
- mode_format == 0120000 ||
28
- mode_format == 040000 ||
29
- mode_format == 0160000
27
+ mode_format = (mode & 0o0170000)
28
+ mode_format == 0o0120000 ||
29
+ mode_format == 0o040000 ||
30
+ mode_format == 0o0160000
30
31
  end
31
32
 
32
33
  def all_files
@@ -42,19 +43,27 @@ module Quality
42
43
  end
43
44
  end
44
45
 
46
+ def language_files(language)
47
+ (@breakdown_by_file[language] || []) - exclude_files
48
+ end
49
+
45
50
  def ruby_files
46
51
  # Linguist treats Gemfile.lock as Ruby code.
47
52
  #
48
53
  # https://github.com/github/linguist/issues/1740
49
- @breakdown_by_file['Ruby'] - ['Gemfile.lock'] || []
54
+ language_files('Ruby') - ['Gemfile.lock']
50
55
  end
51
56
 
52
57
  def python_files
53
- @breakdown_by_file['Python'] || []
58
+ language_files('Python')
54
59
  end
55
60
 
56
61
  def js_files
57
- @breakdown_by_file['JavaScript'] || []
62
+ language_files('JavaScript')
63
+ end
64
+
65
+ def exclude_files
66
+ @exclude_files || []
58
67
  end
59
68
 
60
69
  def real_files_matching
@@ -5,6 +5,9 @@ require 'forwardable'
5
5
  require_relative 'which'
6
6
  require_relative 'directory_of_classes'
7
7
 
8
+ # Quality is a tool that runs quality checks on Ruby code using cane,
9
+ # reek, flog, flay and rubocop and makes sure your numbers don't get
10
+ # any worse over time.
8
11
  module Quality
9
12
  current_dir = File.dirname(File.expand_path(__FILE__))
10
13
  TOOL_CLASSES = DirectoryOfClasses.new(dir: "#{current_dir}/tools",
@@ -4,5 +4,5 @@
4
4
  # reek, flog, flay and rubocop and makes sure your numbers don't get
5
5
  # any worse over time.
6
6
  module Quality
7
- VERSION = '23.0.4'
7
+ VERSION = '23.0.5'
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quality
3
3
  version: !ruby/object:Gem::Version
4
- version: 23.0.4
4
+ version: 23.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vince Broz