pdd 0.24.1 → 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 +4 -2
- data/Gemfile.lock +75 -54
- data/LICENSE.txt +1 -1
- data/LICENSES/MIT.txt +1 -1
- data/README.md +46 -61
- data/REUSE.toml +0 -2
- data/Rakefile +1 -1
- data/assets/puzzles.xsd +1 -1
- data/assets/puzzles.xsl +1 -1
- data/assets/puzzles_json.xsl +1 -1
- data/bin/pdd +3 -4
- data/cucumber.yml +1 -1
- data/features/applies_rules.feature +1 -1
- data/features/avoiding_duplicates.feature +1 -1
- data/features/catches_broken_puzzles.feature +1 -1
- data/features/cli.feature +1 -1
- data/features/gem_package.feature +1 -1
- data/features/html_output.feature +1 -1
- data/features/json_output.feature +1 -1
- data/features/parsing.feature +1 -1
- data/features/rake.feature +1 -1
- data/features/remove.feature +2 -1
- data/features/step_definitions/steps.rb +1 -1
- data/features/support/env.rb +1 -1
- data/features/unicode.feature +1 -1
- data/features/uses_config.feature +1 -1
- data/lib/pdd/puzzle.rb +1 -1
- data/lib/pdd/rake_task.rb +1 -2
- data/lib/pdd/rule/duplicates.rb +1 -1
- data/lib/pdd/rule/estimates.rb +1 -1
- data/lib/pdd/rule/roles.rb +1 -1
- data/lib/pdd/rule/text.rb +1 -1
- data/lib/pdd/source.rb +1 -1
- data/lib/pdd/sources.rb +1 -1
- data/lib/pdd/version.rb +3 -3
- data/lib/pdd.rb +2 -2
- data/pdd.gemspec +2 -2
- data/utils/glob.rb +1 -1
- metadata +2 -31
- data/.0pdd.yml +0 -12
- data/.gitattributes +0 -12
- data/.github/workflows/actionlint.yml +0 -25
- data/.github/workflows/codecov.yml +0 -29
- data/.github/workflows/copyrights.yml +0 -19
- data/.github/workflows/markdown-lint.yml +0 -19
- data/.github/workflows/pdd.yml +0 -19
- data/.github/workflows/rake.yml +0 -29
- data/.github/workflows/reuse.yml +0 -19
- data/.github/workflows/typos.yml +0 -19
- data/.github/workflows/xcop.yml +0 -19
- data/.github/workflows/yamllint.yml +0 -19
- data/.gitignore +0 -15
- data/.markdownlint.yml +0 -6
- data/.pdd +0 -26
- data/.rubocop.yml +0 -42
- data/.rultor.yml +0 -26
- data/.simplecov +0 -18
- data/test/test__helper.rb +0 -44
- data/test/test_duplicates.rb +0 -31
- data/test/test_estimates.rb +0 -30
- data/test/test_many.rb +0 -25
- data/test/test_pdd.rb +0 -94
- data/test/test_rake_task.rb +0 -21
- data/test/test_roles.rb +0 -39
- data/test/test_source.rb +0 -379
- data/test/test_source_todo.rb +0 -278
- data/test/test_sources.rb +0 -120
- data/test/test_text.rb +0 -22
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,4 +1,4 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2014-
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2014-2026 Yegor Bugayenko
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
|
|
4
4
|
source 'https://rubygems.org'
|
|
@@ -6,8 +6,10 @@ gemspec
|
|
|
6
6
|
|
|
7
7
|
gem 'aruba', '~>2.3', require: false
|
|
8
8
|
gem 'cucumber', '~>10.0', require: false
|
|
9
|
-
gem 'minitest', '~>
|
|
9
|
+
gem 'minitest', '~>6.0', require: false
|
|
10
|
+
gem 'minitest-mock', '~>5.27', require: false
|
|
10
11
|
gem 'minitest-reporters', '~>1.7', require: false
|
|
12
|
+
gem 'qbash', '~>0.7', require: false
|
|
11
13
|
gem 'rake', '~>13.0', require: false
|
|
12
14
|
gem 'rdoc', '~>6.4', require: false
|
|
13
15
|
gem 'rubocop', '~>1.60', require: false
|
data/Gemfile.lock
CHANGED
|
@@ -12,90 +12,106 @@ GEM
|
|
|
12
12
|
remote: https://rubygems.org/
|
|
13
13
|
specs:
|
|
14
14
|
ansi (1.5.0)
|
|
15
|
-
aruba (2.3.
|
|
16
|
-
bundler (>= 1.17
|
|
15
|
+
aruba (2.3.3)
|
|
16
|
+
bundler (>= 1.17)
|
|
17
17
|
contracts (>= 0.16.0, < 0.18.0)
|
|
18
18
|
cucumber (>= 8.0, < 11.0)
|
|
19
|
-
rspec-expectations (
|
|
19
|
+
rspec-expectations (>= 3.4, < 5.0)
|
|
20
20
|
thor (~> 1.0)
|
|
21
21
|
ast (2.4.3)
|
|
22
22
|
backtrace (0.4.1)
|
|
23
23
|
base64 (0.3.0)
|
|
24
|
-
bigdecimal (
|
|
24
|
+
bigdecimal (4.0.1)
|
|
25
25
|
builder (3.3.0)
|
|
26
|
-
contracts (0.17.
|
|
27
|
-
cucumber (10.
|
|
26
|
+
contracts (0.17.3)
|
|
27
|
+
cucumber (10.2.0)
|
|
28
28
|
base64 (~> 0.2)
|
|
29
29
|
builder (~> 3.2)
|
|
30
|
-
cucumber-ci-environment (> 9, <
|
|
30
|
+
cucumber-ci-environment (> 9, < 12)
|
|
31
31
|
cucumber-core (> 15, < 17)
|
|
32
|
-
cucumber-cucumber-expressions (> 17, <
|
|
33
|
-
cucumber-html-formatter (>
|
|
32
|
+
cucumber-cucumber-expressions (> 17, < 20)
|
|
33
|
+
cucumber-html-formatter (> 21, < 23)
|
|
34
34
|
diff-lcs (~> 1.5)
|
|
35
35
|
logger (~> 1.6)
|
|
36
36
|
mini_mime (~> 1.1)
|
|
37
37
|
multi_test (~> 1.1)
|
|
38
38
|
sys-uname (~> 1.3)
|
|
39
|
-
cucumber-ci-environment (
|
|
40
|
-
cucumber-core (
|
|
41
|
-
cucumber-gherkin (>
|
|
42
|
-
cucumber-messages (>
|
|
43
|
-
cucumber-tag-expressions (>
|
|
44
|
-
cucumber-cucumber-expressions (
|
|
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
45
|
bigdecimal
|
|
46
|
-
cucumber-gherkin (
|
|
47
|
-
cucumber-messages (
|
|
48
|
-
cucumber-html-formatter (
|
|
49
|
-
cucumber-messages (>
|
|
50
|
-
cucumber-messages (
|
|
51
|
-
cucumber-tag-expressions (
|
|
52
|
-
date (3.
|
|
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
53
|
diff-lcs (1.6.2)
|
|
54
54
|
differ (0.1.2)
|
|
55
55
|
docile (1.4.1)
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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)
|
|
61
65
|
language_server-protocol (3.17.0.5)
|
|
62
66
|
lint_roller (1.1.0)
|
|
63
67
|
logger (1.7.0)
|
|
68
|
+
loog (0.8.0)
|
|
69
|
+
ellipsized
|
|
70
|
+
logger (~> 1.0)
|
|
71
|
+
memoist3 (1.0.0)
|
|
64
72
|
mini_mime (1.1.5)
|
|
65
|
-
minitest (
|
|
73
|
+
minitest (6.0.1)
|
|
74
|
+
prism (~> 1.5)
|
|
75
|
+
minitest-mock (5.27.0)
|
|
66
76
|
minitest-reporters (1.7.1)
|
|
67
77
|
ansi
|
|
68
78
|
builder
|
|
69
79
|
minitest (>= 5.0)
|
|
70
80
|
ruby-progressbar
|
|
71
81
|
multi_test (1.1.0)
|
|
72
|
-
nokogiri (1.
|
|
82
|
+
nokogiri (1.19.0-arm64-darwin)
|
|
73
83
|
racc (~> 1.4)
|
|
74
|
-
nokogiri (1.
|
|
84
|
+
nokogiri (1.19.0-x64-mingw-ucrt)
|
|
75
85
|
racc (~> 1.4)
|
|
76
|
-
nokogiri (1.
|
|
86
|
+
nokogiri (1.19.0-x86_64-linux-gnu)
|
|
77
87
|
racc (~> 1.4)
|
|
78
88
|
parallel (1.27.0)
|
|
79
|
-
parser (3.3.
|
|
89
|
+
parser (3.3.10.1)
|
|
80
90
|
ast (~> 2.4.1)
|
|
81
91
|
racc
|
|
82
|
-
prism (1.
|
|
83
|
-
psych (5.
|
|
92
|
+
prism (1.9.0)
|
|
93
|
+
psych (5.3.1)
|
|
84
94
|
date
|
|
85
95
|
stringio
|
|
96
|
+
qbash (0.7.2)
|
|
97
|
+
backtrace (> 0)
|
|
98
|
+
elapsed (> 0)
|
|
99
|
+
loog (> 0)
|
|
100
|
+
tago (> 0)
|
|
86
101
|
racc (1.8.1)
|
|
87
102
|
rainbow (3.1.1)
|
|
88
|
-
rake (13.3.
|
|
89
|
-
rdoc (6.
|
|
103
|
+
rake (13.3.1)
|
|
104
|
+
rdoc (6.17.0)
|
|
90
105
|
erb
|
|
91
106
|
psych (>= 4.0.0)
|
|
92
|
-
|
|
93
|
-
|
|
107
|
+
tsort
|
|
108
|
+
regexp_parser (2.11.3)
|
|
109
|
+
rexml (3.4.4)
|
|
94
110
|
rspec-expectations (3.13.5)
|
|
95
111
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
96
112
|
rspec-support (~> 3.13.0)
|
|
97
|
-
rspec-support (3.13.
|
|
98
|
-
rubocop (1.
|
|
113
|
+
rspec-support (3.13.7)
|
|
114
|
+
rubocop (1.84.2)
|
|
99
115
|
json (~> 2.3)
|
|
100
116
|
language_server-protocol (~> 3.17.0.2)
|
|
101
117
|
lint_roller (~> 1.1.0)
|
|
@@ -103,20 +119,20 @@ GEM
|
|
|
103
119
|
parser (>= 3.3.0.2)
|
|
104
120
|
rainbow (>= 2.2.2, < 4.0)
|
|
105
121
|
regexp_parser (>= 2.9.3, < 3.0)
|
|
106
|
-
rubocop-ast (>= 1.
|
|
122
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
107
123
|
ruby-progressbar (~> 1.7)
|
|
108
124
|
unicode-display_width (>= 2.4.0, < 4.0)
|
|
109
|
-
rubocop-ast (1.
|
|
125
|
+
rubocop-ast (1.49.0)
|
|
110
126
|
parser (>= 3.3.7.2)
|
|
111
|
-
prism (~> 1.
|
|
112
|
-
rubocop-minitest (0.38.
|
|
127
|
+
prism (~> 1.7)
|
|
128
|
+
rubocop-minitest (0.38.2)
|
|
113
129
|
lint_roller (~> 1.1)
|
|
114
130
|
rubocop (>= 1.75.0, < 2.0)
|
|
115
131
|
rubocop-ast (>= 1.38.0, < 2.0)
|
|
116
|
-
rubocop-performance (1.
|
|
132
|
+
rubocop-performance (1.26.1)
|
|
117
133
|
lint_roller (~> 1.1)
|
|
118
134
|
rubocop (>= 1.75.0, < 2.0)
|
|
119
|
-
rubocop-ast (>= 1.
|
|
135
|
+
rubocop-ast (>= 1.47.1, < 2.0)
|
|
120
136
|
rubocop-rake (0.7.1)
|
|
121
137
|
lint_roller (~> 1.1)
|
|
122
138
|
rubocop (>= 1.72.1)
|
|
@@ -129,16 +145,19 @@ GEM
|
|
|
129
145
|
simplecov-cobertura (2.1.0)
|
|
130
146
|
rexml
|
|
131
147
|
simplecov (~> 0.19)
|
|
132
|
-
simplecov-html (0.13.
|
|
148
|
+
simplecov-html (0.13.2)
|
|
133
149
|
simplecov_json_formatter (0.1.4)
|
|
134
150
|
slop (4.10.1)
|
|
135
|
-
stringio (3.
|
|
136
|
-
sys-uname (1.
|
|
151
|
+
stringio (3.2.0)
|
|
152
|
+
sys-uname (1.4.1)
|
|
137
153
|
ffi (~> 1.1)
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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)
|
|
142
161
|
xcop (0.8.0)
|
|
143
162
|
differ (~> 0.1.2)
|
|
144
163
|
nokogiri (~> 1.10)
|
|
@@ -155,9 +174,11 @@ PLATFORMS
|
|
|
155
174
|
DEPENDENCIES
|
|
156
175
|
aruba (~> 2.3)
|
|
157
176
|
cucumber (~> 10.0)
|
|
158
|
-
minitest (~>
|
|
177
|
+
minitest (~> 6.0)
|
|
178
|
+
minitest-mock (~> 5.27)
|
|
159
179
|
minitest-reporters (~> 1.7)
|
|
160
180
|
pdd!
|
|
181
|
+
qbash (~> 0.7)
|
|
161
182
|
rake (~> 13.0)
|
|
162
183
|
rdoc (~> 6.4)
|
|
163
184
|
rubocop (~> 1.60)
|
data/LICENSE.txt
CHANGED
data/LICENSES/MIT.txt
CHANGED
data/README.md
CHANGED
|
@@ -14,20 +14,17 @@
|
|
|
14
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
|
|
20
|
-
[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].
|
|
21
19
|
|
|
22
20
|
Also, check [0pdd.com](https://www.0pdd.com): a hosted service,
|
|
23
21
|
where this command line tool works for you.
|
|
24
22
|
|
|
25
|
-
Read
|
|
26
|
-
[_PDD in Action_](http://www.yegor256.com/2017/04/05/pdd-in-action.html)
|
|
27
|
-
and watch [this webinar](https://www.youtube.com/watch?v=nsYGC2aUwfQ).
|
|
23
|
+
Read [_PDD in Action_][in-action] and watch this [webinar].
|
|
28
24
|
|
|
29
|
-
First, make sure Ruby 2.6+
|
|
30
|
-
are installed.
|
|
25
|
+
First, make sure Ruby 2.6+
|
|
26
|
+
and [`libmagic`](#how-to-install-libmagic) are installed.
|
|
27
|
+
Then, install our gem:
|
|
31
28
|
|
|
32
29
|
```bash
|
|
33
30
|
gem install pdd
|
|
@@ -41,7 +38,7 @@ pdd --help
|
|
|
41
38
|
|
|
42
39
|
## Usage
|
|
43
40
|
|
|
44
|
-
You can exclude & include certain number of files from the search
|
|
41
|
+
You can exclude & include a certain number of files from the search
|
|
45
42
|
via these options:
|
|
46
43
|
|
|
47
44
|
```bash
|
|
@@ -50,7 +47,7 @@ pdd --exclude glob
|
|
|
50
47
|
|
|
51
48
|
You can skip any file(s) with a name suffix that matches the pattern glob,
|
|
52
49
|
using wildcard matching; a name suffix is either the whole
|
|
53
|
-
path and name, or
|
|
50
|
+
path and name, or a regex, for example:
|
|
54
51
|
|
|
55
52
|
```bash
|
|
56
53
|
pdd --exclude src/**/*.java --exclude target/**/*
|
|
@@ -65,47 +62,25 @@ pdd --include glob
|
|
|
65
62
|
```
|
|
66
63
|
|
|
67
64
|
Search only files whose name matches glob, using wildcard matching
|
|
68
|
-
as described under ``--exclude``.
|
|
65
|
+
as described under ``--exclude``.
|
|
69
66
|
If contradictory ``--include`` and ``--exclude`` options are given,
|
|
70
|
-
the last matching one wins.
|
|
67
|
+
the last matching one wins.
|
|
71
68
|
If no ``--include`` or ``--exclude`` options are given, all files
|
|
72
|
-
from the working directory are included, example:
|
|
69
|
+
from the working directory are included, example:
|
|
73
70
|
|
|
74
71
|
```bash
|
|
75
72
|
pdd --include src/**/*.py # include only .py files in src/
|
|
76
73
|
pdd --include src/**/* # include all files in src/
|
|
77
74
|
```
|
|
78
75
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
```bash
|
|
82
|
-
pdd [--verbose] [--quiet] [--remove] [--skip-gitignore] [--skip-errors] \
|
|
83
|
-
[--source <project_dir_path>] [--file puzzles_file.xml] \
|
|
84
|
-
[--include src/**/*.py] \
|
|
85
|
-
[--format xml|html] [--rule min-words:5] [--exclude src/**/*.java]
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
| Parameter | Description |
|
|
89
|
-
|-------------------------|---------------------------------------------------------------------------------------|
|
|
90
|
-
| --verbose | Enable verbose (debug) mode. --file must be used in case of using this option |
|
|
91
|
-
| --quiet | Disable logs |
|
|
92
|
-
| --remove | Remove all found puzzles from the source code |
|
|
93
|
-
| --skip-gitignore | Don't look into .gitignore for excludes |
|
|
94
|
-
| --skip-errors | Suppress error as warning and skip badly formatted puzzles (do not skip broken rules) |
|
|
95
|
-
| --source project-path | Source directory to parse ("." by default) |
|
|
96
|
-
| --file puzzles.xml | File to save report into (xml or html) (displayed in console by default) |
|
|
97
|
-
| --include *.py | Glob pattern to include (can be used several times) |
|
|
98
|
-
| --exclude *.java | Glob pattern to exclude (can be used several times) |
|
|
99
|
-
| --format xml | Format of the report xml or html (xml is default) |
|
|
100
|
-
| --rule min-words:5 | Rule to apply (can be used several times), described later |
|
|
101
|
-
|
|
102
|
-
:bulb: There is an option to create a .pdd file in your project and save all required parameters in it.
|
|
76
|
+
There is an option to create a .pdd file in your project
|
|
77
|
+
and save all required parameters in it.
|
|
103
78
|
You can see a file example in this project.
|
|
104
79
|
|
|
105
80
|
## How to Format?
|
|
106
81
|
|
|
107
|
-
Every puzzle has to be formatted like this
|
|
108
|
-
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):
|
|
109
84
|
|
|
110
85
|
```java
|
|
111
86
|
/**
|
|
@@ -136,23 +111,26 @@ void sendEmail() {
|
|
|
136
111
|
```
|
|
137
112
|
|
|
138
113
|
If you use it in combination with [0pdd](https://www.0pdd.com),
|
|
139
|
-
after processing this text, the issue titled
|
|
140
|
-
"File.java:10-13: This is something to do later in one of ..."
|
|
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.
|
|
141
117
|
The specified markers will be included in the issues body
|
|
142
|
-
along with some predefined text.
|
|
143
|
-
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.
|
|
144
120
|
|
|
145
121
|
Note: if you create several puzzle duplicates (same text after puzzle keyword),
|
|
146
|
-
pdd
|
|
122
|
+
pdd may fail to parse puzzles and produce an error with duplicates list.
|
|
147
123
|
|
|
148
124
|
There are 3 supported keywords, one of which must precede the mandatory
|
|
149
|
-
puzzle marker.
|
|
125
|
+
puzzle marker.
|
|
126
|
+
They are `@todo`, `TODO` and `TODO:`.
|
|
150
127
|
|
|
151
128
|
As an example, it starts with `@todo`, followed by a space and a mandatory
|
|
152
|
-
puzzle **marker**.
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
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):
|
|
156
134
|
|
|
157
135
|
```text
|
|
158
136
|
// @todo #224 Puzzle description
|
|
@@ -177,10 +155,10 @@ and put a dummy `#1` marker everywhere.
|
|
|
177
155
|
|
|
178
156
|
For multiline puzzles there are two important things:
|
|
179
157
|
|
|
180
|
-
- **prefix** - any optional text followed by space before puzzle keyword (todo).
|
|
181
|
-
It should be the same for all lines of puzzle description.
|
|
182
|
-
-
|
|
183
|
-
prefix should be
|
|
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.
|
|
184
162
|
|
|
185
163
|
Examples:
|
|
186
164
|
|
|
@@ -192,7 +170,7 @@ Examples:
|
|
|
192
170
|
~ But do not forget about the space before puzzle keyword.
|
|
193
171
|
~
|
|
194
172
|
~ @todo #34 Description can be as long as needed.
|
|
195
|
-
~ Just use at least the same amount of
|
|
173
|
+
~ Just use at least the same amount of spaces as on the first line.
|
|
196
174
|
~ It will be added to description.
|
|
197
175
|
-->
|
|
198
176
|
```
|
|
@@ -202,7 +180,7 @@ Examples:
|
|
|
202
180
|
* @todo #36 Multiline text can use the same prefix in all lines or the same
|
|
203
181
|
* amount of spaces.
|
|
204
182
|
* So this will be added to the puzzle description. If you want to divide the
|
|
205
|
-
* puzzle logically by empty line, just add a
|
|
183
|
+
* puzzle logically by an empty line, just add a backslash to that line
|
|
206
184
|
* \
|
|
207
185
|
* and continue the text after.
|
|
208
186
|
*
|
|
@@ -306,11 +284,10 @@ Unfortunately, there is no easy way to install on Windows, try to use
|
|
|
306
284
|
|
|
307
285
|
## How to contribute
|
|
308
286
|
|
|
309
|
-
Read
|
|
310
|
-
Make sure your build is green before you contribute
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
[Bundler](https://bundler.io/) installed. Then:
|
|
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:
|
|
314
291
|
|
|
315
292
|
```bash
|
|
316
293
|
bundle install
|
|
@@ -337,3 +314,11 @@ To run a single unit test:
|
|
|
337
314
|
```bash
|
|
338
315
|
bundle exec ruby test/test_many.rb
|
|
339
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
|
data/REUSE.toml
CHANGED
data/Rakefile
CHANGED
data/assets/puzzles.xsd
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<!--
|
|
3
|
-
* SPDX-FileCopyrightText: Copyright (c) 2014-
|
|
3
|
+
* SPDX-FileCopyrightText: Copyright (c) 2014-2026 Yegor Bugayenko
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
5
|
-->
|
|
6
6
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
data/assets/puzzles.xsl
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<!--
|
|
3
|
-
* SPDX-FileCopyrightText: Copyright (c) 2014-
|
|
3
|
+
* SPDX-FileCopyrightText: Copyright (c) 2014-2026 Yegor Bugayenko
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
5
|
-->
|
|
6
6
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
|
data/assets/puzzles_json.xsl
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<!--
|
|
3
|
-
* SPDX-FileCopyrightText: Copyright (c) 2014-
|
|
3
|
+
* SPDX-FileCopyrightText: Copyright (c) 2014-2026 Yegor Bugayenko
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
5
|
-->
|
|
6
6
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
data/bin/pdd
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
# SPDX-FileCopyrightText: Copyright (c) 2014-
|
|
2
|
+
# SPDX-FileCopyrightText: Copyright (c) 2014-2026 Yegor Bugayenko
|
|
3
3
|
# SPDX-License-Identifier: MIT
|
|
4
4
|
|
|
5
5
|
$stdout.sync = true
|
|
@@ -60,8 +60,7 @@ begin
|
|
|
60
60
|
|
|
61
61
|
if opts.help?
|
|
62
62
|
puts opts
|
|
63
|
-
puts "This is our README to learn more:
|
|
64
|
-
https://github.com/cqfn/pdd/blob/master/README.md"
|
|
63
|
+
puts "This is our README to learn more: https://github.com/cqfn/pdd/blob/master/README.md"
|
|
65
64
|
exit
|
|
66
65
|
end
|
|
67
66
|
|
|
@@ -116,7 +115,7 @@ https://github.com/cqfn/pdd/blob/master/README.md"
|
|
|
116
115
|
File.write(
|
|
117
116
|
f,
|
|
118
117
|
File.readlines(f).reject.each_with_index do |_t, i|
|
|
119
|
-
all.any? { |pair| i +
|
|
118
|
+
all.any? { |pair| (i + 1).between?(pair[0], pair[1]) }
|
|
120
119
|
end.join
|
|
121
120
|
)
|
|
122
121
|
PDD.log.info "#{all.count} puzzles removed from #{src}"
|
data/cucumber.yml
CHANGED
data/features/cli.feature
CHANGED
data/features/parsing.feature
CHANGED
data/features/rake.feature
CHANGED
data/features/remove.feature
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# SPDX-FileCopyrightText: Copyright (c) 2014-
|
|
1
|
+
# SPDX-FileCopyrightText: Copyright (c) 2014-2026 Yegor Bugayenko
|
|
2
2
|
# SPDX-License-Identifier: MIT
|
|
3
3
|
Feature: Removing Puzzles
|
|
4
4
|
As a source code writer I want to be able to
|
|
@@ -15,3 +15,4 @@ Feature: Removing Puzzles
|
|
|
15
15
|
When I run bin/pdd with "-v --remove -f /dev/null"
|
|
16
16
|
Then Exit code is zero
|
|
17
17
|
And Stdout contains "1 puzzles removed from a/test.txt"
|
|
18
|
+
And Text File "a/test.txt" contains "Hello"
|
data/features/support/env.rb
CHANGED
data/features/unicode.feature
CHANGED
data/lib/pdd/puzzle.rb
CHANGED