pdd 0.24.0 → 0.24.2
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 +17 -30
- data/Gemfile.lock +194 -0
- data/LICENSE.txt +1 -1
- data/LICENSES/MIT.txt +21 -0
- data/README.md +99 -100
- data/REUSE.toml +41 -0
- data/Rakefile +4 -31
- data/assets/puzzles.xsd +3 -22
- data/assets/puzzles.xsl +3 -22
- data/assets/puzzles_json.xsl +4 -23
- data/bin/pdd +6 -22
- data/cucumber.yml +3 -0
- data/features/applies_rules.feature +2 -0
- data/features/avoiding_duplicates.feature +2 -0
- data/features/catches_broken_puzzles.feature +2 -0
- data/features/cli.feature +2 -0
- data/features/gem_package.feature +2 -0
- data/features/html_output.feature +2 -0
- data/features/json_output.feature +2 -0
- data/features/parsing.feature +2 -0
- data/features/rake.feature +2 -2
- data/features/remove.feature +3 -0
- data/features/step_definitions/steps.rb +2 -19
- data/features/support/env.rb +2 -19
- data/features/unicode.feature +2 -0
- data/features/uses_config.feature +2 -1
- data/lib/pdd/puzzle.rb +2 -19
- data/lib/pdd/rake_task.rb +3 -1
- data/lib/pdd/rule/duplicates.rb +2 -19
- data/lib/pdd/rule/estimates.rb +2 -19
- data/lib/pdd/rule/roles.rb +2 -19
- data/lib/pdd/rule/text.rb +2 -19
- data/lib/pdd/source.rb +2 -19
- data/lib/pdd/sources.rb +2 -19
- data/lib/pdd/version.rb +4 -21
- data/lib/pdd.rb +3 -20
- data/pdd.gemspec +9 -25
- data/test_assets/aladdin.jpg +0 -0
- data/test_assets/elegant-objects.png +0 -0
- data/test_assets/puzzles/1-04e35eb3 +1 -1
- data/test_assets/puzzles/132-bc1dfafe +1 -1
- data/test_assets/puzzles/1425-59819ae3 +5 -5
- data/test_assets/puzzles/42-0d933cc0 +1 -1
- data/test_assets/puzzles/91-ecb9aa47 +1 -1
- data/test_assets/puzzles/93-641fe341 +1 -1
- data/utils/glob.rb +2 -19
- metadata +24 -33
- data/.0pdd.yml +0 -9
- data/.gitattributes +0 -12
- data/.github/workflows/codecov.yml +0 -23
- data/.github/workflows/pdd.yml +0 -15
- data/.github/workflows/rake.yml +0 -24
- data/.github/workflows/xcop.yml +0 -15
- data/.gitignore +0 -8
- data/.overcommit.yml +0 -96
- data/.pdd +0 -27
- data/.rubocop.yml +0 -32
- data/.rultor.yml +0 -22
- data/.simplecov +0 -35
- data/test/test__helper.rb +0 -43
- data/test/test_duplicates.rb +0 -48
- data/test/test_estimates.rb +0 -47
- data/test/test_many.rb +0 -42
- data/test/test_pdd.rb +0 -111
- data/test/test_rake_task.rb +0 -18
- data/test/test_roles.rb +0 -56
- data/test/test_source.rb +0 -396
- data/test/test_source_todo.rb +0 -295
- data/test/test_sources.rb +0 -137
- data/test/test_text.rb +0 -39
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8a148c10b8622117b159e5028dfb46217b4f4d7c7089f3f1b83f7b687d6c28f9
|
|
4
|
+
data.tar.gz: eed97950b5a4b11e3a29538c3db6f84a09ea09338d9a60ed023d4fc9b9f7baf3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e7e1dacd6208a3be0886a30f01419636637027f94ef3ec3fbd5420ec8992b0c78ea0602a9cd936eeebc4c91a5c907ee0e440761b369cc46f190a8a4379686ab0
|
|
7
|
+
data.tar.gz: 5e9d4fca897139802b7aff1c38eb54788ad1f8d2b4ecbd6075b053b248b3361751184b960f1cdcd45fab272358b6feb96acbca44695b6aeb579fb6a50cc04a6a
|
data/Gemfile
CHANGED
|
@@ -1,35 +1,22 @@
|
|
|
1
|
-
# Copyright (c) 2014-
|
|
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) 2014-2026 Yegor Bugayenko
|
|
2
|
+
# SPDX-License-Identifier: MIT
|
|
20
3
|
|
|
21
4
|
source 'https://rubygems.org'
|
|
22
5
|
gemspec
|
|
23
6
|
|
|
24
|
-
gem 'aruba', '~>
|
|
25
|
-
gem 'cucumber', '
|
|
26
|
-
gem 'minitest', '
|
|
27
|
-
gem '
|
|
28
|
-
gem '
|
|
29
|
-
gem '
|
|
30
|
-
gem '
|
|
31
|
-
gem '
|
|
32
|
-
gem '
|
|
7
|
+
gem 'aruba', '~>2.3', require: false
|
|
8
|
+
gem 'cucumber', '~>10.0', require: false
|
|
9
|
+
gem 'minitest', '~>6.0', require: false
|
|
10
|
+
gem 'minitest-mock', '~>5.27', require: false
|
|
11
|
+
gem 'minitest-reporters', '~>1.7', require: false
|
|
12
|
+
gem 'qbash', '~>0.7', require: false
|
|
13
|
+
gem 'rake', '~>13.0', require: false
|
|
14
|
+
gem 'rdoc', '~>6.4', require: false
|
|
15
|
+
gem 'rubocop', '~>1.60', require: false
|
|
16
|
+
gem 'rubocop-minitest', '~>0.38', require: false
|
|
17
|
+
gem 'rubocop-performance', '~>1.25', require: false
|
|
18
|
+
gem 'rubocop-rake', '~>0.7', require: false
|
|
19
|
+
gem 'simplecov', '~>0.22', require: false
|
|
33
20
|
gem 'simplecov-cobertura', '~> 2.1'
|
|
34
|
-
gem 'slop', '4.9
|
|
35
|
-
gem 'xcop', '0
|
|
21
|
+
gem 'slop', '~>4.9', require: false
|
|
22
|
+
gem 'xcop', '>0', require: false
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
pdd (0.0.0)
|
|
5
|
+
backtrace (~> 0.1)
|
|
6
|
+
nokogiri (~> 1.10)
|
|
7
|
+
rainbow (~> 3.0)
|
|
8
|
+
ruby-filemagic (~> 0.7)
|
|
9
|
+
slop (~> 4.6)
|
|
10
|
+
|
|
11
|
+
GEM
|
|
12
|
+
remote: https://rubygems.org/
|
|
13
|
+
specs:
|
|
14
|
+
ansi (1.5.0)
|
|
15
|
+
aruba (2.3.3)
|
|
16
|
+
bundler (>= 1.17)
|
|
17
|
+
contracts (>= 0.16.0, < 0.18.0)
|
|
18
|
+
cucumber (>= 8.0, < 11.0)
|
|
19
|
+
rspec-expectations (>= 3.4, < 5.0)
|
|
20
|
+
thor (~> 1.0)
|
|
21
|
+
ast (2.4.3)
|
|
22
|
+
backtrace (0.4.1)
|
|
23
|
+
base64 (0.3.0)
|
|
24
|
+
bigdecimal (4.0.1)
|
|
25
|
+
builder (3.3.0)
|
|
26
|
+
contracts (0.17.3)
|
|
27
|
+
cucumber (10.2.0)
|
|
28
|
+
base64 (~> 0.2)
|
|
29
|
+
builder (~> 3.2)
|
|
30
|
+
cucumber-ci-environment (> 9, < 12)
|
|
31
|
+
cucumber-core (> 15, < 17)
|
|
32
|
+
cucumber-cucumber-expressions (> 17, < 20)
|
|
33
|
+
cucumber-html-formatter (> 21, < 23)
|
|
34
|
+
diff-lcs (~> 1.5)
|
|
35
|
+
logger (~> 1.6)
|
|
36
|
+
mini_mime (~> 1.1)
|
|
37
|
+
multi_test (~> 1.1)
|
|
38
|
+
sys-uname (~> 1.3)
|
|
39
|
+
cucumber-ci-environment (11.0.0)
|
|
40
|
+
cucumber-core (16.2.0)
|
|
41
|
+
cucumber-gherkin (> 36, < 40)
|
|
42
|
+
cucumber-messages (> 31, < 33)
|
|
43
|
+
cucumber-tag-expressions (> 6, < 9)
|
|
44
|
+
cucumber-cucumber-expressions (19.0.0)
|
|
45
|
+
bigdecimal
|
|
46
|
+
cucumber-gherkin (38.0.0)
|
|
47
|
+
cucumber-messages (>= 31, < 33)
|
|
48
|
+
cucumber-html-formatter (22.3.0)
|
|
49
|
+
cucumber-messages (> 23, < 33)
|
|
50
|
+
cucumber-messages (32.0.1)
|
|
51
|
+
cucumber-tag-expressions (8.1.0)
|
|
52
|
+
date (3.5.1)
|
|
53
|
+
diff-lcs (1.6.2)
|
|
54
|
+
differ (0.1.2)
|
|
55
|
+
docile (1.4.1)
|
|
56
|
+
elapsed (0.3.1)
|
|
57
|
+
loog (~> 0.6)
|
|
58
|
+
tago (~> 0.1)
|
|
59
|
+
ellipsized (0.3.0)
|
|
60
|
+
erb (6.0.1)
|
|
61
|
+
ffi (1.17.3-arm64-darwin)
|
|
62
|
+
ffi (1.17.3-x64-mingw-ucrt)
|
|
63
|
+
ffi (1.17.3-x86_64-linux-gnu)
|
|
64
|
+
json (2.18.1)
|
|
65
|
+
language_server-protocol (3.17.0.5)
|
|
66
|
+
lint_roller (1.1.0)
|
|
67
|
+
logger (1.7.0)
|
|
68
|
+
loog (0.8.0)
|
|
69
|
+
ellipsized
|
|
70
|
+
logger (~> 1.0)
|
|
71
|
+
memoist3 (1.0.0)
|
|
72
|
+
mini_mime (1.1.5)
|
|
73
|
+
minitest (6.0.1)
|
|
74
|
+
prism (~> 1.5)
|
|
75
|
+
minitest-mock (5.27.0)
|
|
76
|
+
minitest-reporters (1.7.1)
|
|
77
|
+
ansi
|
|
78
|
+
builder
|
|
79
|
+
minitest (>= 5.0)
|
|
80
|
+
ruby-progressbar
|
|
81
|
+
multi_test (1.1.0)
|
|
82
|
+
nokogiri (1.19.0-arm64-darwin)
|
|
83
|
+
racc (~> 1.4)
|
|
84
|
+
nokogiri (1.19.0-x64-mingw-ucrt)
|
|
85
|
+
racc (~> 1.4)
|
|
86
|
+
nokogiri (1.19.0-x86_64-linux-gnu)
|
|
87
|
+
racc (~> 1.4)
|
|
88
|
+
parallel (1.27.0)
|
|
89
|
+
parser (3.3.10.1)
|
|
90
|
+
ast (~> 2.4.1)
|
|
91
|
+
racc
|
|
92
|
+
prism (1.9.0)
|
|
93
|
+
psych (5.3.1)
|
|
94
|
+
date
|
|
95
|
+
stringio
|
|
96
|
+
qbash (0.7.2)
|
|
97
|
+
backtrace (> 0)
|
|
98
|
+
elapsed (> 0)
|
|
99
|
+
loog (> 0)
|
|
100
|
+
tago (> 0)
|
|
101
|
+
racc (1.8.1)
|
|
102
|
+
rainbow (3.1.1)
|
|
103
|
+
rake (13.3.1)
|
|
104
|
+
rdoc (6.17.0)
|
|
105
|
+
erb
|
|
106
|
+
psych (>= 4.0.0)
|
|
107
|
+
tsort
|
|
108
|
+
regexp_parser (2.11.3)
|
|
109
|
+
rexml (3.4.4)
|
|
110
|
+
rspec-expectations (3.13.5)
|
|
111
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
|
112
|
+
rspec-support (~> 3.13.0)
|
|
113
|
+
rspec-support (3.13.7)
|
|
114
|
+
rubocop (1.84.2)
|
|
115
|
+
json (~> 2.3)
|
|
116
|
+
language_server-protocol (~> 3.17.0.2)
|
|
117
|
+
lint_roller (~> 1.1.0)
|
|
118
|
+
parallel (~> 1.10)
|
|
119
|
+
parser (>= 3.3.0.2)
|
|
120
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
121
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
|
122
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
123
|
+
ruby-progressbar (~> 1.7)
|
|
124
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
125
|
+
rubocop-ast (1.49.0)
|
|
126
|
+
parser (>= 3.3.7.2)
|
|
127
|
+
prism (~> 1.7)
|
|
128
|
+
rubocop-minitest (0.38.2)
|
|
129
|
+
lint_roller (~> 1.1)
|
|
130
|
+
rubocop (>= 1.75.0, < 2.0)
|
|
131
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
|
132
|
+
rubocop-performance (1.26.1)
|
|
133
|
+
lint_roller (~> 1.1)
|
|
134
|
+
rubocop (>= 1.75.0, < 2.0)
|
|
135
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
136
|
+
rubocop-rake (0.7.1)
|
|
137
|
+
lint_roller (~> 1.1)
|
|
138
|
+
rubocop (>= 1.72.1)
|
|
139
|
+
ruby-filemagic (0.7.3)
|
|
140
|
+
ruby-progressbar (1.13.0)
|
|
141
|
+
simplecov (0.22.0)
|
|
142
|
+
docile (~> 1.1)
|
|
143
|
+
simplecov-html (~> 0.11)
|
|
144
|
+
simplecov_json_formatter (~> 0.1)
|
|
145
|
+
simplecov-cobertura (2.1.0)
|
|
146
|
+
rexml
|
|
147
|
+
simplecov (~> 0.19)
|
|
148
|
+
simplecov-html (0.13.2)
|
|
149
|
+
simplecov_json_formatter (0.1.4)
|
|
150
|
+
slop (4.10.1)
|
|
151
|
+
stringio (3.2.0)
|
|
152
|
+
sys-uname (1.4.1)
|
|
153
|
+
ffi (~> 1.1)
|
|
154
|
+
memoist3 (~> 1.0.0)
|
|
155
|
+
tago (0.7.0)
|
|
156
|
+
thor (1.5.0)
|
|
157
|
+
tsort (0.2.0)
|
|
158
|
+
unicode-display_width (3.2.0)
|
|
159
|
+
unicode-emoji (~> 4.1)
|
|
160
|
+
unicode-emoji (4.2.0)
|
|
161
|
+
xcop (0.8.0)
|
|
162
|
+
differ (~> 0.1.2)
|
|
163
|
+
nokogiri (~> 1.10)
|
|
164
|
+
rainbow (~> 3.0)
|
|
165
|
+
slop (~> 4.4)
|
|
166
|
+
|
|
167
|
+
PLATFORMS
|
|
168
|
+
arm64-darwin-22
|
|
169
|
+
arm64-darwin-23
|
|
170
|
+
arm64-darwin-24
|
|
171
|
+
x64-mingw-ucrt
|
|
172
|
+
x86_64-linux
|
|
173
|
+
|
|
174
|
+
DEPENDENCIES
|
|
175
|
+
aruba (~> 2.3)
|
|
176
|
+
cucumber (~> 10.0)
|
|
177
|
+
minitest (~> 6.0)
|
|
178
|
+
minitest-mock (~> 5.27)
|
|
179
|
+
minitest-reporters (~> 1.7)
|
|
180
|
+
pdd!
|
|
181
|
+
qbash (~> 0.7)
|
|
182
|
+
rake (~> 13.0)
|
|
183
|
+
rdoc (~> 6.4)
|
|
184
|
+
rubocop (~> 1.60)
|
|
185
|
+
rubocop-minitest (~> 0.38)
|
|
186
|
+
rubocop-performance (~> 1.25)
|
|
187
|
+
rubocop-rake (~> 0.7)
|
|
188
|
+
simplecov (~> 0.22)
|
|
189
|
+
simplecov-cobertura (~> 2.1)
|
|
190
|
+
slop (~> 4.9)
|
|
191
|
+
xcop (> 0)
|
|
192
|
+
|
|
193
|
+
BUNDLED WITH
|
|
194
|
+
2.5.16
|
data/LICENSE.txt
CHANGED
data/LICENSES/MIT.txt
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
(The MIT License)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014-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,102 +1,86 @@
|
|
|
1
|
-
|
|
1
|
+
# Collector of TODO Puzzles in Source Code
|
|
2
2
|
|
|
3
3
|
[](https://www.elegantobjects.org)
|
|
4
|
-
[](https://www.rultor.com/p/cqfn/pdd)
|
|
5
5
|
[](https://www.jetbrains.com/ruby/)
|
|
6
6
|
|
|
7
7
|
[](https://github.com/cqfn/pdd/actions/workflows/rake.yml)
|
|
8
|
-
[](https://www.0pdd.com/p?name=cqfn/pdd)
|
|
9
9
|
[](https://codecov.io/gh/yegor/pdd)
|
|
10
10
|
[](https://hitsofcode.com/view/github/cqfn/pdd)
|
|
11
11
|
[](https://github.com/cqfn/pdd/blob/master/LICENSE.txt)
|
|
12
|
-
[](
|
|
12
|
+
[](https://badge.fury.io/rb/pdd)
|
|
13
13
|
[](https://codeclimate.com/github/cqfn/pdd/maintainability)
|
|
14
|
-
[](https://rubydoc.info/github/cqfn/pdd/master/frames)
|
|
15
15
|
[](https://www.codacy.com/gh/cqfn/pdd/dashboard?utm_source=github.com&utm_medium=referral&utm_content=cqfn/pdd&utm_campaign=Badge_Grade)
|
|
16
16
|
|
|
17
|
-
Read this article about
|
|
18
|
-
[
|
|
19
|
-
Check also patent application [US 12/840,306](http://www.google.com/patents/US20120023476)
|
|
17
|
+
Read this article about [_Puzzle Driven Development_][blog].
|
|
18
|
+
Also, check the patent application [US 12/840,306][patent].
|
|
20
19
|
|
|
21
|
-
Also, check [0pdd.com](
|
|
20
|
+
Also, check [0pdd.com](https://www.0pdd.com): a hosted service,
|
|
22
21
|
where this command line tool works for you.
|
|
23
22
|
|
|
24
|
-
Read
|
|
25
|
-
[_PDD in Action_](http://www.yegor256.com/2017/04/05/pdd-in-action.html)
|
|
26
|
-
and watch [this webinar](https://www.youtube.com/watch?v=nsYGC2aUwfQ).
|
|
23
|
+
Read [_PDD in Action_][in-action] and watch this [webinar].
|
|
27
24
|
|
|
28
|
-
First, make sure Ruby 2.6+
|
|
25
|
+
First, make sure Ruby 2.6+
|
|
26
|
+
and [`libmagic`](#how-to-install-libmagic) are installed.
|
|
27
|
+
Then, install our gem:
|
|
29
28
|
|
|
30
29
|
```bash
|
|
31
|
-
|
|
30
|
+
gem install pdd
|
|
32
31
|
```
|
|
33
32
|
|
|
34
33
|
Run it locally and read its output:
|
|
35
34
|
|
|
36
35
|
```bash
|
|
37
|
-
|
|
36
|
+
pdd --help
|
|
38
37
|
```
|
|
39
38
|
|
|
40
39
|
## Usage
|
|
41
40
|
|
|
42
|
-
You can exclude & include certain number of files from the search
|
|
41
|
+
You can exclude & include a certain number of files from the search
|
|
42
|
+
via these options:
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
|
-
|
|
45
|
+
pdd --exclude glob
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
-
You can skip any file(s) with a name suffix that matches the pattern glob,
|
|
49
|
-
a name suffix is either the whole
|
|
48
|
+
You can skip any file(s) with a name suffix that matches the pattern glob,
|
|
49
|
+
using wildcard matching; a name suffix is either the whole
|
|
50
|
+
path and name, or a regex, for example:
|
|
50
51
|
|
|
51
52
|
```bash
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
pdd --exclude src/**/*.java --exclude target/**/*
|
|
54
|
+
pdd --exclude src/**/*.java # exclude .java files in src/
|
|
55
|
+
pdd --exclude src/**/* # exclude all files in src/
|
|
55
56
|
```
|
|
56
57
|
|
|
57
58
|
You can include too:
|
|
58
59
|
|
|
59
60
|
```bash
|
|
60
|
-
|
|
61
|
+
pdd --include glob
|
|
61
62
|
```
|
|
62
63
|
|
|
63
|
-
Search only files whose name matches glob, using wildcard matching
|
|
64
|
-
|
|
65
|
-
If
|
|
64
|
+
Search only files whose name matches glob, using wildcard matching
|
|
65
|
+
as described under ``--exclude``.
|
|
66
|
+
If contradictory ``--include`` and ``--exclude`` options are given,
|
|
67
|
+
the last matching one wins.
|
|
68
|
+
If no ``--include`` or ``--exclude`` options are given, all files
|
|
69
|
+
from the working directory are included, example:
|
|
66
70
|
|
|
67
71
|
```bash
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
pdd --include src/**/*.py # include only .py files in src/
|
|
73
|
+
pdd --include src/**/* # include all files in src/
|
|
70
74
|
```
|
|
71
75
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
[--source <project_dir_path>] [--file puzzles_file.xml] [--include src/**/*.py] \
|
|
76
|
-
[--format xml|html] [--rule min-words:5] [--exclude src/**/*.java]
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
| Parameter | Description |
|
|
80
|
-
|-------------------------|---------------------------------------------------------------------------------------|
|
|
81
|
-
| --verbose | Enable verbose (debug) mode. --file must be used in case of using this option |
|
|
82
|
-
| --quiet | Disable logs |
|
|
83
|
-
| --remove | Remove all found puzzles from the source code |
|
|
84
|
-
| --skip-gitignore | Don't look into .gitignore for excludes |
|
|
85
|
-
| --skip-errors | Suppress error as warning and skip badly formatted puzzles (do not skip broken rules) |
|
|
86
|
-
| --source <project-path> | Source directory to parse ("." by default) |
|
|
87
|
-
| --file puzzles.xml | File to save report into (xml of html) (displayed in console by default) |
|
|
88
|
-
| --include *.py | Glob pattern to include (can be used several times) |
|
|
89
|
-
| --exclude *.java | Glob pattern to exclude (can be used several times) |
|
|
90
|
-
| --format xml | Format of the report xml or html (xml is default) |
|
|
91
|
-
| --rule min-words:5 | Rule to apply (can be used several times), described later |
|
|
92
|
-
|
|
93
|
-
:bulb: There is an option to create a .pdd file in your project and save all required parameters in it.
|
|
94
|
-
File example you can see in this project.
|
|
76
|
+
There is an option to create a .pdd file in your project
|
|
77
|
+
and save all required parameters in it.
|
|
78
|
+
You can see a file example in this project.
|
|
95
79
|
|
|
96
80
|
## How to Format?
|
|
97
81
|
|
|
98
|
-
Every puzzle has to be formatted like this
|
|
99
|
-
to the leading space in every consecutive line):
|
|
82
|
+
Every puzzle has to be formatted like this
|
|
83
|
+
(pay attention to the leading space in every consecutive line):
|
|
100
84
|
|
|
101
85
|
```java
|
|
102
86
|
/**
|
|
@@ -116,83 +100,87 @@ Example:
|
|
|
116
100
|
* @todo #234:15m/DEV This is something to do later
|
|
117
101
|
* in one of the next releases. I can't figure out
|
|
118
102
|
* how to implement it now, that's why the puzzle.
|
|
119
|
-
* The text can be so long, as needed, just use
|
|
120
|
-
* the same
|
|
121
|
-
* This text will be
|
|
122
|
-
* it has less spaces.
|
|
103
|
+
* The text can be so long, as needed, just use
|
|
104
|
+
* the same amount of spaces, as the second line.
|
|
105
|
+
* This text will not be a part of the puzzle, as
|
|
106
|
+
* it has less spaces.
|
|
123
107
|
*/
|
|
124
108
|
void sendEmail() {
|
|
125
109
|
throw new UnsupportedOperationException();
|
|
126
110
|
}
|
|
127
111
|
```
|
|
128
112
|
|
|
129
|
-
If you use it in combination with [0pdd](
|
|
130
|
-
after processing this text, the issue titled
|
|
131
|
-
"File.java:10-13: This is something to do later in one of ..."
|
|
113
|
+
If you use it in combination with [0pdd](https://www.0pdd.com),
|
|
114
|
+
after processing this text, the issue titled
|
|
115
|
+
"File.java:10-13: This is something to do later in one of ..."
|
|
116
|
+
will be created.
|
|
132
117
|
The specified markers will be included in the issues body
|
|
133
|
-
along with some predefined text.
|
|
134
|
-
than 40 characters, it will be truncated in the title.
|
|
118
|
+
along with some predefined text.
|
|
119
|
+
If your comment is longer than 40 characters, it will be truncated in the title.
|
|
135
120
|
|
|
136
121
|
Note: if you create several puzzle duplicates (same text after puzzle keyword),
|
|
137
|
-
pdd
|
|
122
|
+
pdd may fail to parse puzzles and produce an error with duplicates list.
|
|
138
123
|
|
|
139
124
|
There are 3 supported keywords, one of which must precede the mandatory
|
|
140
|
-
puzzle marker.
|
|
125
|
+
puzzle marker.
|
|
126
|
+
They are `@todo`, `TODO` and `TODO:`.
|
|
141
127
|
|
|
142
128
|
As an example, it starts with `@todo`, followed by a space and a mandatory
|
|
143
|
-
puzzle **marker**.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
of the
|
|
129
|
+
puzzle **marker**.
|
|
130
|
+
Possible formats of puzzle markers
|
|
131
|
+
(it doesn't matter what the line starts with and where it is located,
|
|
132
|
+
as long as you have one of the 3 supported keywords right in front
|
|
133
|
+
of the mandatory marker):
|
|
147
134
|
|
|
148
|
-
```
|
|
135
|
+
```text
|
|
149
136
|
// @todo #224 Puzzle description
|
|
150
137
|
# @todo #55:45min Puzzle description
|
|
151
138
|
@todo #67/DES Puzzle description
|
|
152
139
|
;; @todo #678:40m/DEV Puzzle description
|
|
153
|
-
// TODO
|
|
140
|
+
// TODO #TEST-21:30min Puzzle description
|
|
154
141
|
```
|
|
155
142
|
|
|
156
|
-
Here `DES` and `DEV` are the roles of people who must fix
|
|
143
|
+
Here `DES` and `DEV` are the roles of people who must fix these puzzles;
|
|
157
144
|
`45min` and `40m` is the amount of time the puzzle should take;
|
|
158
145
|
`224`, `55`, `67`, `678` and `TEST-21` are the IDs of the tickets
|
|
159
146
|
these puzzles are coming from.
|
|
160
147
|
|
|
161
148
|
Markers are absolutely necessary for all puzzles, because they allow
|
|
162
149
|
us to build a hierarchical dependency tree of all puzzles, like
|
|
163
|
-
[this one](
|
|
150
|
+
[this one](https://www.0pdd.com/p?name=yegor256/takes),
|
|
164
151
|
for example. Technically, of course, you can abuse the system
|
|
165
152
|
and put a dummy `#1` marker everywhere.
|
|
166
153
|
|
|
167
154
|
### Multiline examples
|
|
168
155
|
|
|
169
156
|
For multiline puzzles there are two important things:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
157
|
+
|
|
158
|
+
- **prefix** - any optional text followed by a space before puzzle keyword (todo).
|
|
159
|
+
It should be the same for all lines of the puzzle description.
|
|
160
|
+
- The `\` symbol can be used to logically divide the puzzle description.
|
|
161
|
+
The prefix should be present with it.
|
|
174
162
|
|
|
175
163
|
Examples:
|
|
176
164
|
|
|
177
165
|
```xml
|
|
178
|
-
<!--
|
|
179
|
-
~ if
|
|
166
|
+
<!--
|
|
167
|
+
~ if comments should be started and closed by special symbols, then place them in
|
|
180
168
|
~ a separate lines
|
|
181
169
|
~ Any symbol can be used as a prefix, it will be excluded from the text.
|
|
182
170
|
~ But do not forget about the space before puzzle keyword.
|
|
183
171
|
~
|
|
184
172
|
~ @todo #34 Description can be as long as needed.
|
|
185
|
-
~ Just use at least the same amount of
|
|
173
|
+
~ Just use at least the same amount of spaces as on the first line.
|
|
186
174
|
~ It will be added to description.
|
|
187
175
|
-->
|
|
188
176
|
```
|
|
189
177
|
|
|
190
178
|
```java
|
|
191
179
|
/**
|
|
192
|
-
* @todo #36 Multiline text can use the same prefix in all lines or the same
|
|
180
|
+
* @todo #36 Multiline text can use the same prefix in all lines or the same
|
|
193
181
|
* amount of spaces.
|
|
194
|
-
* So this will be added to the puzzle description. If you want to divide the
|
|
195
|
-
* puzzle logically by empty line, just add a
|
|
182
|
+
* So this will be added to the puzzle description. If you want to divide the
|
|
183
|
+
* puzzle logically by an empty line, just add a backslash to that line
|
|
196
184
|
* \
|
|
197
185
|
* and continue the text after.
|
|
198
186
|
*
|
|
@@ -207,7 +195,7 @@ You can specify post-parsing rules for your puzzles, in command line,
|
|
|
207
195
|
for example:
|
|
208
196
|
|
|
209
197
|
```bash
|
|
210
|
-
|
|
198
|
+
pdd --rule min-estimate:60 --rule max-estimate:120
|
|
211
199
|
```
|
|
212
200
|
|
|
213
201
|
These two parameters will add two post-parsing rules `min-estimate`
|
|
@@ -233,12 +221,13 @@ Here is a list of rules available now:
|
|
|
233
221
|
|
|
234
222
|
:bulb: You can put all command line options into `.pdd` file. The options from the
|
|
235
223
|
file will be used first. Command line options may be added on top of them.
|
|
236
|
-
See, how it is done in
|
|
224
|
+
See, how it is done in
|
|
225
|
+
[yegor256/0pdd](https://github.com/yegor256/0pdd/blob/master/.pdd).
|
|
237
226
|
|
|
238
227
|
## How to read XML
|
|
239
228
|
|
|
240
229
|
The XML produced will look approximately like this (here is a
|
|
241
|
-
[real example](
|
|
230
|
+
[real example](https://www.0pdd.com/snapshot?name=yegor256/takes)):
|
|
242
231
|
|
|
243
232
|
```xml
|
|
244
233
|
<puzzles>
|
|
@@ -256,6 +245,7 @@ The XML produced will look approximately like this (here is a
|
|
|
256
245
|
</puzzle>
|
|
257
246
|
</puzzles>
|
|
258
247
|
```
|
|
248
|
+
|
|
259
249
|
NOTE: puzzles are saved with utf-8 encoding
|
|
260
250
|
|
|
261
251
|
[XSD Schema](http://pdd-xsd.teamed.io/0.19.4.xsd) is here.
|
|
@@ -279,35 +269,36 @@ The most interesting parts of each puzzle are:
|
|
|
279
269
|
For Debian/Ubuntu:
|
|
280
270
|
|
|
281
271
|
```bash
|
|
282
|
-
|
|
272
|
+
apt install libmagic-dev
|
|
283
273
|
```
|
|
284
274
|
|
|
285
|
-
For
|
|
275
|
+
For macOS:
|
|
286
276
|
|
|
287
277
|
```bash
|
|
288
|
-
|
|
278
|
+
brew install libmagic
|
|
289
279
|
```
|
|
290
280
|
|
|
291
|
-
Unfortunately, there is no easy way to install on Windows, try to use
|
|
292
|
-
[WSL](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux) or
|
|
281
|
+
Unfortunately, there is no easy way to install on Windows, try to use
|
|
282
|
+
[WSL](https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux) or
|
|
293
283
|
[Docker](https://www.docker.com/).
|
|
294
284
|
|
|
295
285
|
## How to contribute
|
|
296
286
|
|
|
297
|
-
Read
|
|
298
|
-
Make sure your build is green before you contribute
|
|
299
|
-
|
|
300
|
-
|
|
287
|
+
Read these [guidelines].
|
|
288
|
+
Make sure your build is green before you contribute your pull request.
|
|
289
|
+
You need to have [Ruby] 2.7+ and [Bundler] installed.
|
|
290
|
+
Then:
|
|
301
291
|
|
|
302
292
|
```bash
|
|
303
|
-
|
|
304
|
-
|
|
293
|
+
bundle install
|
|
294
|
+
bundle exec rake
|
|
305
295
|
```
|
|
306
296
|
|
|
307
297
|
Next, install and run overcommit to install hooks (required once)
|
|
298
|
+
|
|
308
299
|
```bash
|
|
309
|
-
|
|
310
|
-
|
|
300
|
+
gem install overcommit -v '=0.58.0'
|
|
301
|
+
overcommit --install
|
|
311
302
|
```
|
|
312
303
|
|
|
313
304
|
If it's clean and you don't see any error messages, submit your pull request.
|
|
@@ -315,11 +306,19 @@ If it's clean and you don't see any error messages, submit your pull request.
|
|
|
315
306
|
This is how you run the tool locally to test how it works:
|
|
316
307
|
|
|
317
308
|
```bash
|
|
318
|
-
|
|
309
|
+
./bin/pdd --help
|
|
319
310
|
```
|
|
320
311
|
|
|
321
312
|
To run a single unit test:
|
|
322
313
|
|
|
323
314
|
```bash
|
|
324
|
-
|
|
315
|
+
bundle exec ruby test/test_many.rb
|
|
325
316
|
```
|
|
317
|
+
|
|
318
|
+
[blog]: http://www.yegor256.com/2009/03/04/pdd.html
|
|
319
|
+
[patent]: http://www.google.com/patents/US20120023476
|
|
320
|
+
[in-action]: http://www.yegor256.com/2017/04/05/pdd-in-action.html
|
|
321
|
+
[webinar]: https://www.youtube.com/watch?v=nsYGC2aUwfQ
|
|
322
|
+
[Ruby]: https://www.ruby-lang.org/en/
|
|
323
|
+
[Bundler]: https://bundler.io/
|
|
324
|
+
[guidelines]: https://www.yegor256.com/2014/04/15/github-guidelines.html
|