quality 23.0.4 → 23.0.5
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/quality/config.rb +3 -6
- data/lib/quality/linguist_source_file_globber.rb +16 -7
- data/lib/quality/runner.rb +3 -0
- data/lib/quality/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 732e0610b537876b8c8b74dfc803953d8d120dde
|
4
|
+
data.tar.gz: 376e9210a56020a21858619014e464182cda8ded
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ae72fdd804d9c7ba776c9c5163998f76aa43ba26fe7473ece5906965735cd5da963c7fbe8a6a8b9ce3cc61dd2f6d01b682aedd0ee54fc6314188b5a1fcfee6c
|
7
|
+
data.tar.gz: 7896609e60a8934ea4f43256b64f0f1e42a998aa7e6ba72cf0098f2ffc6f0657fc524df34279d5d8c373b25c3937d27e101ce891b9eb15e102cd3558736c4921
|
data/lib/quality/config.rb
CHANGED
@@ -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
|
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 &
|
27
|
-
mode_format ==
|
28
|
-
mode_format ==
|
29
|
-
mode_format ==
|
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
|
-
|
54
|
+
language_files('Ruby') - ['Gemfile.lock']
|
50
55
|
end
|
51
56
|
|
52
57
|
def python_files
|
53
|
-
|
58
|
+
language_files('Python')
|
54
59
|
end
|
55
60
|
|
56
61
|
def js_files
|
57
|
-
|
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
|
data/lib/quality/runner.rb
CHANGED
@@ -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",
|
data/lib/quality/version.rb
CHANGED