xcop 0.7.2 → 0.9.0
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/Gemfile +14 -32
- data/Gemfile.lock +182 -0
- data/LICENSE.txt +1 -1
- data/LICENSES/MIT.txt +21 -0
- data/README.md +35 -40
- data/REUSE.toml +36 -0
- data/Rakefile +4 -22
- data/bin/xcop +6 -32
- data/cucumber.yml +2 -21
- data/features/cli.feature +19 -38
- data/features/gem_package.feature +2 -0
- data/features/rake.feature +2 -0
- data/features/step_definitions/steps.rb +2 -19
- data/features/support/env.rb +2 -19
- data/lib/xcop/cli.rb +14 -31
- data/lib/xcop/document.rb +4 -36
- data/lib/xcop/rake_task.rb +5 -23
- data/lib/xcop/version.rb +4 -21
- data/logo.svg +1 -1
- data/xcop.gemspec +5 -22
- metadata +8 -22
- data/.0pdd.yml +0 -31
- data/.gitattributes +0 -7
- data/.github/workflows/actionlint.yml +0 -44
- data/.github/workflows/copyrights.yml +0 -37
- data/.github/workflows/pdd.yml +0 -33
- data/.github/workflows/rake.yml +0 -44
- data/.github/workflows/xcop.yml +0 -33
- data/.github/workflows/yamllint.yml +0 -37
- data/.gitignore +0 -7
- data/.pdd +0 -7
- data/.rubocop.yml +0 -45
- data/.rultor.yml +0 -45
- data/.simplecov +0 -38
- data/renovate.json +0 -6
- data/test/test__helper.rb +0 -29
- data/test/test_document.rb +0 -111
- data/test/test_rake_task.rb +0 -59
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f920205808498fe938096e3c94b78366b740bd435c80a96e1c6b414609db2580
|
|
4
|
+
data.tar.gz: 99ceffd495685cd59a26788dc8c1f8ef384d105ffc80967e0e12443639585829
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8859eebb530bbad420b2645b4971fcb2c272a244957de2d6575e932a9ba516ecd6112bd6369da69a61ac2ad08cdba228ea45bf92427be69b713d885c16620f75
|
|
7
|
+
data.tar.gz: b38404a73d36189719654efbf9f1f3c0e12fdbeab9cd8d7e207224e2470e0de8d77ad72dc4b955fc82ebe12f19ab6b585ddc658672186d7f19170cad08e0c3ac
|
data/Gemfile
CHANGED
|
@@ -1,37 +1,19 @@
|
|
|
1
|
-
# Copyright (c) 2017-
|
|
2
|
-
#
|
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
# furnished to do so, subject to the following conditions:
|
|
9
|
-
#
|
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
11
|
-
# copies or substantial portions of the Software.
|
|
12
|
-
#
|
|
13
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
-
# SOFTWARE.
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2017-2026 Yegor Bugayenko
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
20
3
|
|
|
21
4
|
source 'https://rubygems.org'
|
|
22
5
|
gemspec
|
|
23
6
|
|
|
24
|
-
gem 'cucumber', '
|
|
7
|
+
gem 'cucumber', '~>11.0', require: false
|
|
8
|
+
gem 'erb', '~>6.0', require: false
|
|
25
9
|
gem 'loog', '>0', require: false
|
|
26
|
-
gem 'minitest', '
|
|
27
|
-
gem 'minitest-reporters', '1.7
|
|
28
|
-
gem 'rake', '13.2
|
|
29
|
-
gem '
|
|
30
|
-
gem 'rubocop', '
|
|
31
|
-
gem 'rubocop-
|
|
32
|
-
gem 'rubocop-
|
|
33
|
-
gem '
|
|
34
|
-
gem '
|
|
35
|
-
gem '
|
|
36
|
-
gem 'simplecov-cobertura', '2.1.0', require: false
|
|
37
|
-
gem 'yard', '0.9.37', require: false
|
|
10
|
+
gem 'minitest', '~>6.0', require: false
|
|
11
|
+
gem 'minitest-reporters', '~>1.7', require: false
|
|
12
|
+
gem 'rake', '~>13.2', require: false
|
|
13
|
+
gem 'rubocop', '~>1.75', require: false
|
|
14
|
+
gem 'rubocop-minitest', '~>0.38', require: false
|
|
15
|
+
gem 'rubocop-performance', '~>1.25', require: false
|
|
16
|
+
gem 'rubocop-rake', '~>0.7', require: false
|
|
17
|
+
gem 'simplecov', '~>0.22', require: false
|
|
18
|
+
gem 'simplecov-cobertura', '~>3.1', require: false
|
|
19
|
+
gem 'yard', '~>0.9', require: false
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
xcop (0.0.0)
|
|
5
|
+
differ (~> 0.1.2)
|
|
6
|
+
nokogiri (~> 1.8)
|
|
7
|
+
rainbow (~> 3.0)
|
|
8
|
+
slop (~> 4.4)
|
|
9
|
+
|
|
10
|
+
GEM
|
|
11
|
+
remote: https://rubygems.org/
|
|
12
|
+
specs:
|
|
13
|
+
ansi (1.6.0)
|
|
14
|
+
ast (2.4.3)
|
|
15
|
+
base64 (0.3.0)
|
|
16
|
+
bigdecimal (4.1.1)
|
|
17
|
+
builder (3.3.0)
|
|
18
|
+
cucumber (11.0.0)
|
|
19
|
+
base64 (~> 0.2)
|
|
20
|
+
builder (~> 3.2)
|
|
21
|
+
cucumber-ci-environment (> 9, < 12)
|
|
22
|
+
cucumber-core (>= 16.2.0, < 17)
|
|
23
|
+
cucumber-cucumber-expressions (> 17, < 20)
|
|
24
|
+
cucumber-html-formatter (> 21, < 24)
|
|
25
|
+
diff-lcs (~> 1.5)
|
|
26
|
+
logger (~> 1.6)
|
|
27
|
+
mini_mime (~> 1.1)
|
|
28
|
+
multi_test (~> 1.1)
|
|
29
|
+
sys-uname (~> 1.5)
|
|
30
|
+
cucumber-ci-environment (11.0.0)
|
|
31
|
+
cucumber-core (16.2.0)
|
|
32
|
+
cucumber-gherkin (> 36, < 40)
|
|
33
|
+
cucumber-messages (> 31, < 33)
|
|
34
|
+
cucumber-tag-expressions (> 6, < 9)
|
|
35
|
+
cucumber-cucumber-expressions (19.0.0)
|
|
36
|
+
bigdecimal
|
|
37
|
+
cucumber-gherkin (39.0.0)
|
|
38
|
+
cucumber-messages (>= 31, < 33)
|
|
39
|
+
cucumber-html-formatter (23.1.0)
|
|
40
|
+
cucumber-messages (> 23, < 33)
|
|
41
|
+
cucumber-messages (32.3.1)
|
|
42
|
+
cucumber-tag-expressions (8.1.0)
|
|
43
|
+
diff-lcs (1.6.2)
|
|
44
|
+
differ (0.1.2)
|
|
45
|
+
docile (1.4.1)
|
|
46
|
+
drb (2.2.3)
|
|
47
|
+
ellipsized (0.3.0)
|
|
48
|
+
erb (6.0.4)
|
|
49
|
+
ffi (1.17.4-aarch64-linux-gnu)
|
|
50
|
+
ffi (1.17.4-aarch64-linux-musl)
|
|
51
|
+
ffi (1.17.4-arm-linux-gnu)
|
|
52
|
+
ffi (1.17.4-arm-linux-musl)
|
|
53
|
+
ffi (1.17.4-arm64-darwin)
|
|
54
|
+
ffi (1.17.4-x64-mingw-ucrt)
|
|
55
|
+
ffi (1.17.4-x86_64-darwin)
|
|
56
|
+
ffi (1.17.4-x86_64-linux-gnu)
|
|
57
|
+
ffi (1.17.4-x86_64-linux-musl)
|
|
58
|
+
json (2.19.3)
|
|
59
|
+
language_server-protocol (3.17.0.5)
|
|
60
|
+
lint_roller (1.1.0)
|
|
61
|
+
logger (1.7.0)
|
|
62
|
+
loog (0.8.0)
|
|
63
|
+
ellipsized
|
|
64
|
+
logger (~> 1.0)
|
|
65
|
+
memoist3 (1.0.0)
|
|
66
|
+
mini_mime (1.1.5)
|
|
67
|
+
minitest (6.0.5)
|
|
68
|
+
drb (~> 2.0)
|
|
69
|
+
prism (~> 1.5)
|
|
70
|
+
minitest-reporters (1.8.0)
|
|
71
|
+
ansi
|
|
72
|
+
builder
|
|
73
|
+
minitest (>= 5.0, < 7)
|
|
74
|
+
ruby-progressbar
|
|
75
|
+
multi_test (1.1.0)
|
|
76
|
+
nokogiri (1.19.0-aarch64-linux-gnu)
|
|
77
|
+
racc (~> 1.4)
|
|
78
|
+
nokogiri (1.19.0-aarch64-linux-musl)
|
|
79
|
+
racc (~> 1.4)
|
|
80
|
+
nokogiri (1.19.0-arm-linux-gnu)
|
|
81
|
+
racc (~> 1.4)
|
|
82
|
+
nokogiri (1.19.0-arm-linux-musl)
|
|
83
|
+
racc (~> 1.4)
|
|
84
|
+
nokogiri (1.19.0-arm64-darwin)
|
|
85
|
+
racc (~> 1.4)
|
|
86
|
+
nokogiri (1.19.0-x64-mingw-ucrt)
|
|
87
|
+
racc (~> 1.4)
|
|
88
|
+
nokogiri (1.19.0-x86_64-darwin)
|
|
89
|
+
racc (~> 1.4)
|
|
90
|
+
nokogiri (1.19.0-x86_64-linux-gnu)
|
|
91
|
+
racc (~> 1.4)
|
|
92
|
+
nokogiri (1.19.0-x86_64-linux-musl)
|
|
93
|
+
racc (~> 1.4)
|
|
94
|
+
parallel (1.27.0)
|
|
95
|
+
parser (3.3.11.1)
|
|
96
|
+
ast (~> 2.4.1)
|
|
97
|
+
racc
|
|
98
|
+
prism (1.9.0)
|
|
99
|
+
racc (1.8.1)
|
|
100
|
+
rainbow (3.1.1)
|
|
101
|
+
rake (13.4.2)
|
|
102
|
+
regexp_parser (2.11.3)
|
|
103
|
+
rexml (3.4.4)
|
|
104
|
+
rubocop (1.86.1)
|
|
105
|
+
json (~> 2.3)
|
|
106
|
+
language_server-protocol (~> 3.17.0.2)
|
|
107
|
+
lint_roller (~> 1.1.0)
|
|
108
|
+
parallel (>= 1.10)
|
|
109
|
+
parser (>= 3.3.0.2)
|
|
110
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
111
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
112
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
113
|
+
ruby-progressbar (~> 1.7)
|
|
114
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
115
|
+
rubocop-ast (1.49.1)
|
|
116
|
+
parser (>= 3.3.7.2)
|
|
117
|
+
prism (~> 1.7)
|
|
118
|
+
rubocop-minitest (0.39.1)
|
|
119
|
+
lint_roller (~> 1.1)
|
|
120
|
+
rubocop (>= 1.75.0, < 2.0)
|
|
121
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
|
122
|
+
rubocop-performance (1.26.1)
|
|
123
|
+
lint_roller (~> 1.1)
|
|
124
|
+
rubocop (>= 1.75.0, < 2.0)
|
|
125
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
126
|
+
rubocop-rake (0.7.1)
|
|
127
|
+
lint_roller (~> 1.1)
|
|
128
|
+
rubocop (>= 1.72.1)
|
|
129
|
+
ruby-progressbar (1.13.0)
|
|
130
|
+
simplecov (0.22.0)
|
|
131
|
+
docile (~> 1.1)
|
|
132
|
+
simplecov-html (~> 0.11)
|
|
133
|
+
simplecov_json_formatter (~> 0.1)
|
|
134
|
+
simplecov-cobertura (3.1.0)
|
|
135
|
+
rexml
|
|
136
|
+
simplecov (~> 0.19)
|
|
137
|
+
simplecov-html (0.13.2)
|
|
138
|
+
simplecov_json_formatter (0.1.4)
|
|
139
|
+
slop (4.10.1)
|
|
140
|
+
sys-uname (1.5.1)
|
|
141
|
+
ffi (~> 1.1)
|
|
142
|
+
memoist3 (~> 1.0.0)
|
|
143
|
+
sys-uname (1.5.1-universal-mingw32)
|
|
144
|
+
ffi (~> 1.1)
|
|
145
|
+
memoist3 (~> 1.0.0)
|
|
146
|
+
win32ole
|
|
147
|
+
unicode-display_width (3.2.0)
|
|
148
|
+
unicode-emoji (~> 4.1)
|
|
149
|
+
unicode-emoji (4.2.0)
|
|
150
|
+
win32ole (1.9.3)
|
|
151
|
+
yard (0.9.43)
|
|
152
|
+
|
|
153
|
+
PLATFORMS
|
|
154
|
+
aarch64-linux-gnu
|
|
155
|
+
aarch64-linux-musl
|
|
156
|
+
arm-linux-gnu
|
|
157
|
+
arm-linux-musl
|
|
158
|
+
arm64-darwin
|
|
159
|
+
arm64-darwin-23
|
|
160
|
+
x64-mingw-ucrt
|
|
161
|
+
x86_64-darwin
|
|
162
|
+
x86_64-linux-gnu
|
|
163
|
+
x86_64-linux-musl
|
|
164
|
+
|
|
165
|
+
DEPENDENCIES
|
|
166
|
+
cucumber (~> 11.0)
|
|
167
|
+
erb (~> 6.0)
|
|
168
|
+
loog (> 0)
|
|
169
|
+
minitest (~> 6.0)
|
|
170
|
+
minitest-reporters (~> 1.7)
|
|
171
|
+
rake (~> 13.2)
|
|
172
|
+
rubocop (~> 1.75)
|
|
173
|
+
rubocop-minitest (~> 0.38)
|
|
174
|
+
rubocop-performance (~> 1.25)
|
|
175
|
+
rubocop-rake (~> 0.7)
|
|
176
|
+
simplecov (~> 0.22)
|
|
177
|
+
simplecov-cobertura (~> 3.1)
|
|
178
|
+
xcop!
|
|
179
|
+
yard (~> 0.9)
|
|
180
|
+
|
|
181
|
+
BUNDLED WITH
|
|
182
|
+
2.5.16
|
data/LICENSE.txt
CHANGED
data/LICENSES/MIT.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2017-2026 Yegor Bugayenko
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the 'Software'), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
|
@@ -1,70 +1,68 @@
|
|
|
1
|
-
|
|
1
|
+
# Style Checker (Linter) for XML Files
|
|
2
2
|
|
|
3
3
|
[](https://www.elegantobjects.org)
|
|
4
|
-
[](https://www.rultor.com/p/yegor256/xcop)
|
|
5
5
|
[](https://www.jetbrains.com/ruby/)
|
|
6
6
|
|
|
7
7
|
[](https://github.com/yegor256/xcop/actions/workflows/rake.yml)
|
|
8
|
-
[](
|
|
8
|
+
[](https://www.0pdd.com/p?name=yegor256/xcop)
|
|
9
|
+
[](https://badge.fury.io/rb/xcop)
|
|
10
10
|
[](https://github.com/yegor256/xcop/blob/master/LICENSE.txt)
|
|
11
|
-
[](https://codeclimate.com/github/yegor256/xcop/maintainability)
|
|
12
11
|
[](https://codecov.io/github/yegor256/xcop?branch=master)
|
|
13
|
-

|
|
14
12
|
[](https://hitsofcode.com/view/github/yegor256/xcop)
|
|
15
13
|
|
|
16
14
|
This command line tool validates your XML files for proper formatting.
|
|
17
|
-
If they are not formatted correctly, it prints the difference
|
|
18
|
-
exits with an error.
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
If they are not formatted correctly, it prints the difference
|
|
16
|
+
and exits with an error.
|
|
17
|
+
You can use it in two ways: 1) to fail your build if any XML-ish files
|
|
18
|
+
(for example, XML, XSD, XSL, or XHTML) are not formatted correctly,
|
|
19
|
+
and 2) to format them correctly using the `--fix` option.
|
|
21
20
|
|
|
22
|
-
Read this blog post first:
|
|
23
|
-
[_XCOP—XML Style Checker_](https://www.yegor256.com/2017/08/29/xcop.html).
|
|
21
|
+
Read this blog post first: [_XCOP—XML Style Checker_][blog].
|
|
24
22
|
|
|
25
|
-
Make sure you have [Ruby installed
|
|
26
|
-
and then install the tool:
|
|
23
|
+
Make sure you have [Ruby] installed and then install the tool:
|
|
27
24
|
|
|
28
25
|
```bash
|
|
29
|
-
|
|
26
|
+
gem install xcop
|
|
30
27
|
```
|
|
31
28
|
|
|
32
29
|
Run it locally and read its output:
|
|
33
30
|
|
|
34
31
|
```bash
|
|
35
|
-
|
|
32
|
+
xcop --help
|
|
36
33
|
```
|
|
37
34
|
|
|
38
35
|
To validate formatting of your XML files just pass their names
|
|
39
36
|
as arguments:
|
|
40
37
|
|
|
41
38
|
```bash
|
|
42
|
-
|
|
39
|
+
xcop file1.xml file2.xml
|
|
43
40
|
```
|
|
44
41
|
|
|
45
42
|
If your files are not formatted correctly and `xcop` complains, you
|
|
46
|
-
can ask it to "beautify" them
|
|
43
|
+
can ask it to "beautify" them using the `--fix` option:
|
|
47
44
|
|
|
48
45
|
```bash
|
|
49
|
-
|
|
46
|
+
xcop --fix broken-file.xml
|
|
50
47
|
```
|
|
51
48
|
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
You can also pass a directory as an argument. In that case `xcop` will
|
|
50
|
+
recursively find every `.xml`, `.xsd`, `.xhtml`, `.xsl`, and `.html`
|
|
51
|
+
file inside it:
|
|
54
52
|
|
|
55
53
|
```bash
|
|
56
|
-
|
|
54
|
+
xcop .
|
|
55
|
+
xcop --fix src/resources
|
|
57
56
|
```
|
|
58
57
|
|
|
59
58
|
## Defaults
|
|
60
59
|
|
|
61
|
-
You can put command line options into `.xcop` file in the directory
|
|
60
|
+
You can put command line options into a `.xcop` file in the directory
|
|
62
61
|
where you start `xcop`. Each option should take a single line in the file.
|
|
63
|
-
They all
|
|
64
|
-
as
|
|
62
|
+
They will all be _added_ to the list of options you specify. For example,
|
|
63
|
+
as suggested in [this blog post](https://www.yegor256.com/2022/07/20/command-line-defaults.html):
|
|
65
64
|
|
|
66
|
-
```
|
|
67
|
-
--license=LICENSE.txt
|
|
65
|
+
```text
|
|
68
66
|
--nocolor
|
|
69
67
|
--quiet
|
|
70
68
|
--include=**/*
|
|
@@ -83,7 +81,6 @@ This is what you need there:
|
|
|
83
81
|
require 'xcop/rake_task'
|
|
84
82
|
desc 'Run XCop on all XML/XSL files in all directories'
|
|
85
83
|
Xcop::RakeTask.new(:xcop) do |task|
|
|
86
|
-
task.license = 'LICENSE.txt' # no license by default
|
|
87
84
|
task.quiet = true # FALSE by default
|
|
88
85
|
task.includes = ['**/*.xml', '**/*.xsl'] # xml|xsd|xhtml|xsl|html by default
|
|
89
86
|
task.excludes = ['target/**/*'] # empty by default
|
|
@@ -92,7 +89,7 @@ end
|
|
|
92
89
|
|
|
93
90
|
## How to use as GitHub action?
|
|
94
91
|
|
|
95
|
-
Create new workflow file in repository under `.github/workflows/xcop.yml`:
|
|
92
|
+
Create a new workflow file in your repository under `.github/workflows/xcop.yml`:
|
|
96
93
|
|
|
97
94
|
```yaml
|
|
98
95
|
---
|
|
@@ -114,12 +111,11 @@ jobs:
|
|
|
114
111
|
- uses: g4s8/xcop-action@master
|
|
115
112
|
```
|
|
116
113
|
|
|
117
|
-
To customize
|
|
114
|
+
To customize the files pattern, use the `files` parameter:
|
|
118
115
|
|
|
119
116
|
```yaml
|
|
120
117
|
- uses: g4s8/xcop-action@master
|
|
121
118
|
with:
|
|
122
|
-
license: MY_LICENSE.txt
|
|
123
119
|
files: "src/*.xml"
|
|
124
120
|
```
|
|
125
121
|
|
|
@@ -144,8 +140,6 @@ You can integrate it with the help of
|
|
|
144
140
|
<configuration>
|
|
145
141
|
<target>
|
|
146
142
|
<apply executable="xcop" failonerror="true">
|
|
147
|
-
<arg value="--license"/>
|
|
148
|
-
<arg value="LICENSE.txt"/>
|
|
149
143
|
<fileset dir=".">
|
|
150
144
|
<include name="**/*.xml"/>
|
|
151
145
|
<include name="**/*.xsd"/>
|
|
@@ -175,8 +169,6 @@ Something like this should work:
|
|
|
175
169
|
[...]
|
|
176
170
|
<target name="xcop">
|
|
177
171
|
<apply executable="xcop" failonerror="true">
|
|
178
|
-
<arg value="--license"/>
|
|
179
|
-
<arg value="LICENSE.txt"/>
|
|
180
172
|
<fileset dir=".">
|
|
181
173
|
<include name="**/*.xml"/>
|
|
182
174
|
<include name="**/*.xsd"/>
|
|
@@ -191,13 +183,16 @@ Something like this should work:
|
|
|
191
183
|
## How to contribute
|
|
192
184
|
|
|
193
185
|
Read [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
|
|
194
|
-
Make sure
|
|
195
|
-
|
|
186
|
+
Make sure your build is green before you contribute your pull request.
|
|
187
|
+
You will need to have [Ruby](https://www.ruby-lang.org/en/) 2.3+ and
|
|
196
188
|
[Bundler](https://bundler.io/) installed. Then:
|
|
197
189
|
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
|
|
190
|
+
```bash
|
|
191
|
+
bundle update
|
|
192
|
+
bundle exec rake
|
|
201
193
|
```
|
|
202
194
|
|
|
203
195
|
If it's clean and you don't see any error messages, submit your pull request.
|
|
196
|
+
|
|
197
|
+
[Ruby]: https://www.ruby-lang.org/en/documentation/installation/
|
|
198
|
+
[blog]: https://www.yegor256.com/2017/08/29/xcop.html
|
data/REUSE.toml
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2025 Yegor Bugayenko
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
3
|
+
|
|
4
|
+
version = 1
|
|
5
|
+
[[annotations]]
|
|
6
|
+
path = [
|
|
7
|
+
".DS_Store",
|
|
8
|
+
".gitattributes",
|
|
9
|
+
".gitignore",
|
|
10
|
+
".pdd",
|
|
11
|
+
"**.json",
|
|
12
|
+
"**.md",
|
|
13
|
+
"**.png",
|
|
14
|
+
"**.svg",
|
|
15
|
+
"**.txt",
|
|
16
|
+
"**/.DS_Store",
|
|
17
|
+
"**/.gitignore",
|
|
18
|
+
"**/.pdd",
|
|
19
|
+
"**/*.csv",
|
|
20
|
+
"**/*.jpg",
|
|
21
|
+
"**/*.json",
|
|
22
|
+
"**/*.md",
|
|
23
|
+
"**/*.pdf",
|
|
24
|
+
"**/*.png",
|
|
25
|
+
"**/*.svg",
|
|
26
|
+
"**/*.txt",
|
|
27
|
+
"**/*.vm",
|
|
28
|
+
"**/CNAME",
|
|
29
|
+
"**/Gemfile.lock",
|
|
30
|
+
"Gemfile.lock",
|
|
31
|
+
"README.md",
|
|
32
|
+
"renovate.json",
|
|
33
|
+
]
|
|
34
|
+
precedence = "override"
|
|
35
|
+
SPDX-FileCopyrightText = "Copyright (c) 2025 Yegor Bugayenko"
|
|
36
|
+
SPDX-License-Identifier = "MIT"
|
data/Rakefile
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
|
-
# Copyright (c) 2017-
|
|
2
|
-
#
|
|
3
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
|
5
|
-
# in the Software without restriction, including without limitation the rights
|
|
6
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
8
|
-
# furnished to do so, subject to the following conditions:
|
|
9
|
-
#
|
|
10
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
11
|
-
# copies or substantial portions of the Software.
|
|
12
|
-
#
|
|
13
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
-
# SOFTWARE.
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2017-2026 Yegor Bugayenko
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
20
3
|
|
|
21
4
|
require 'rubygems'
|
|
22
5
|
require 'rake'
|
|
23
|
-
require 'rdoc'
|
|
24
6
|
require 'rake/clean'
|
|
25
7
|
|
|
26
8
|
def name
|
|
@@ -46,14 +28,14 @@ require 'yard'
|
|
|
46
28
|
desc 'Build Yard documentation'
|
|
47
29
|
YARD::Rake::YardocTask.new do |t|
|
|
48
30
|
t.files = ['lib/**/*.rb']
|
|
31
|
+
t.options = ['--fail-on-warning']
|
|
49
32
|
end
|
|
50
33
|
|
|
51
34
|
require 'rubocop/rake_task'
|
|
52
35
|
desc 'Run RuboCop on all directories'
|
|
53
36
|
RuboCop::RakeTask.new(:rubocop) do |task|
|
|
54
37
|
task.fail_on_error = true
|
|
55
|
-
task.
|
|
56
|
-
task.options = ['--display-cop-names']
|
|
38
|
+
task.options = ['--display-cop-names', '--config', '.rubocop.yml']
|
|
57
39
|
end
|
|
58
40
|
|
|
59
41
|
require 'cucumber/rake/task'
|
data/bin/xcop
CHANGED
|
@@ -1,23 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
# Copyright (c) 2017-
|
|
3
|
-
#
|
|
4
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
|
6
|
-
# in the Software without restriction, including without limitation the rights
|
|
7
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
9
|
-
# furnished to do so, subject to the following conditions:
|
|
10
|
-
#
|
|
11
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
12
|
-
# copies or substantial portions of the Software.
|
|
13
|
-
#
|
|
14
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
-
# SOFTWARE.
|
|
2
|
+
# SPDX-FileCopyrightText: Copyright (c) 2017-2026 Yegor Bugayenko
|
|
3
|
+
# SPDX-License-Identifier: MIT
|
|
21
4
|
|
|
22
5
|
STDOUT.sync = true
|
|
23
6
|
|
|
@@ -47,7 +30,7 @@ opts = Slop.parse(args, strict: true, help: true) do |o|
|
|
|
47
30
|
o.bool '--version', 'Show current version'
|
|
48
31
|
o.bool '--fix', 'Fix all files instead of reporting their problems'
|
|
49
32
|
o.bool '--nocolor', 'Suppress colored output'
|
|
50
|
-
o.string '--license', '
|
|
33
|
+
o.string '--license', 'This option is deprecated'
|
|
51
34
|
o.array '--include', 'Glob pattern(s) to include'
|
|
52
35
|
o.array '--exclude', 'Glob pattern(s) to exclude'
|
|
53
36
|
end
|
|
@@ -65,15 +48,6 @@ end
|
|
|
65
48
|
Encoding.default_external = Encoding::UTF_8
|
|
66
49
|
Encoding.default_internal = Encoding::UTF_8
|
|
67
50
|
|
|
68
|
-
license = ''
|
|
69
|
-
if opts.license?
|
|
70
|
-
unless File.exist?(opts[:license])
|
|
71
|
-
puts "License file is absent: #{opts[:license]}"
|
|
72
|
-
exit -1
|
|
73
|
-
end
|
|
74
|
-
license = File.read(opts[:license])
|
|
75
|
-
end
|
|
76
|
-
|
|
77
51
|
files = Set.new
|
|
78
52
|
|
|
79
53
|
if opts[:include]
|
|
@@ -91,16 +65,16 @@ if opts[:exclude]
|
|
|
91
65
|
end
|
|
92
66
|
|
|
93
67
|
if opts.fix?
|
|
94
|
-
Xcop::CLI.new(files
|
|
68
|
+
Xcop::CLI.new(files).fix do |f|
|
|
95
69
|
puts "#{f} fixed" unless opts.quiet?
|
|
96
70
|
end
|
|
97
71
|
else
|
|
98
72
|
begin
|
|
99
|
-
Xcop::CLI.new(files,
|
|
73
|
+
Xcop::CLI.new(files, nocolor: opts.nocolor?).run do |f|
|
|
100
74
|
puts "#{f} looks good" unless opts.quiet?
|
|
101
75
|
end
|
|
102
76
|
rescue StandardError => e
|
|
103
77
|
puts e.message
|
|
104
|
-
exit
|
|
78
|
+
exit 1
|
|
105
79
|
end
|
|
106
80
|
end
|
data/cucumber.yml
CHANGED
|
@@ -1,24 +1,5 @@
|
|
|
1
|
-
# (
|
|
2
|
-
#
|
|
3
|
-
# Copyright (c) 2017-2025 Yegor Bugayenko
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the 'Software'), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
# copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
# SOFTWARE.
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2017-2026 Yegor Bugayenko
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
22
3
|
---
|
|
23
4
|
default: --format pretty
|
|
24
5
|
travis: --format progress
|