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.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +17 -30
  3. data/Gemfile.lock +194 -0
  4. data/LICENSE.txt +1 -1
  5. data/LICENSES/MIT.txt +21 -0
  6. data/README.md +99 -100
  7. data/REUSE.toml +41 -0
  8. data/Rakefile +4 -31
  9. data/assets/puzzles.xsd +3 -22
  10. data/assets/puzzles.xsl +3 -22
  11. data/assets/puzzles_json.xsl +4 -23
  12. data/bin/pdd +6 -22
  13. data/cucumber.yml +3 -0
  14. data/features/applies_rules.feature +2 -0
  15. data/features/avoiding_duplicates.feature +2 -0
  16. data/features/catches_broken_puzzles.feature +2 -0
  17. data/features/cli.feature +2 -0
  18. data/features/gem_package.feature +2 -0
  19. data/features/html_output.feature +2 -0
  20. data/features/json_output.feature +2 -0
  21. data/features/parsing.feature +2 -0
  22. data/features/rake.feature +2 -2
  23. data/features/remove.feature +3 -0
  24. data/features/step_definitions/steps.rb +2 -19
  25. data/features/support/env.rb +2 -19
  26. data/features/unicode.feature +2 -0
  27. data/features/uses_config.feature +2 -1
  28. data/lib/pdd/puzzle.rb +2 -19
  29. data/lib/pdd/rake_task.rb +3 -1
  30. data/lib/pdd/rule/duplicates.rb +2 -19
  31. data/lib/pdd/rule/estimates.rb +2 -19
  32. data/lib/pdd/rule/roles.rb +2 -19
  33. data/lib/pdd/rule/text.rb +2 -19
  34. data/lib/pdd/source.rb +2 -19
  35. data/lib/pdd/sources.rb +2 -19
  36. data/lib/pdd/version.rb +4 -21
  37. data/lib/pdd.rb +3 -20
  38. data/pdd.gemspec +9 -25
  39. data/test_assets/aladdin.jpg +0 -0
  40. data/test_assets/elegant-objects.png +0 -0
  41. data/test_assets/puzzles/1-04e35eb3 +1 -1
  42. data/test_assets/puzzles/132-bc1dfafe +1 -1
  43. data/test_assets/puzzles/1425-59819ae3 +5 -5
  44. data/test_assets/puzzles/42-0d933cc0 +1 -1
  45. data/test_assets/puzzles/91-ecb9aa47 +1 -1
  46. data/test_assets/puzzles/93-641fe341 +1 -1
  47. data/utils/glob.rb +2 -19
  48. metadata +24 -33
  49. data/.0pdd.yml +0 -9
  50. data/.gitattributes +0 -12
  51. data/.github/workflows/codecov.yml +0 -23
  52. data/.github/workflows/pdd.yml +0 -15
  53. data/.github/workflows/rake.yml +0 -24
  54. data/.github/workflows/xcop.yml +0 -15
  55. data/.gitignore +0 -8
  56. data/.overcommit.yml +0 -96
  57. data/.pdd +0 -27
  58. data/.rubocop.yml +0 -32
  59. data/.rultor.yml +0 -22
  60. data/.simplecov +0 -35
  61. data/test/test__helper.rb +0 -43
  62. data/test/test_duplicates.rb +0 -48
  63. data/test/test_estimates.rb +0 -47
  64. data/test/test_many.rb +0 -42
  65. data/test/test_pdd.rb +0 -111
  66. data/test/test_rake_task.rb +0 -18
  67. data/test/test_roles.rb +0 -56
  68. data/test/test_source.rb +0 -396
  69. data/test/test_source_todo.rb +0 -295
  70. data/test/test_sources.rb +0 -137
  71. data/test/test_text.rb +0 -39
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 91fcdc9f020a0b464387833136eb5cd9c55c40c995cce419950587a899d6b1a4
4
- data.tar.gz: 7638e25104a15816702cc73c797df3fcf6673b85761864d2ae5a1d3749f90b14
3
+ metadata.gz: 8a148c10b8622117b159e5028dfb46217b4f4d7c7089f3f1b83f7b687d6c28f9
4
+ data.tar.gz: eed97950b5a4b11e3a29538c3db6f84a09ea09338d9a60ed023d4fc9b9f7baf3
5
5
  SHA512:
6
- metadata.gz: 61502311ce40384236b872397b728a15a9633401376c1ec79718b314d96f9a86e3e3a899f7267d93633c3b9842272ad77bfdbe904cd9133ce49a057a1b548dcb
7
- data.tar.gz: 35e1de4d7b2318bd77c662016fbea96619165f309b512c59897ea5270ad5973c681b835638d8d4bcc2a48e83b25b84bc7597e5ddaeda7b27e51b2dc8c6aee714
6
+ metadata.gz: e7e1dacd6208a3be0886a30f01419636637027f94ef3ec3fbd5420ec8992b0c78ea0602a9cd936eeebc4c91a5c907ee0e440761b369cc46f190a8a4379686ab0
7
+ data.tar.gz: 5e9d4fca897139802b7aff1c38eb54788ad1f8d2b4ecbd6075b053b248b3361751184b960f1cdcd45fab272358b6feb96acbca44695b6aeb579fb6a50cc04a6a
data/Gemfile CHANGED
@@ -1,35 +1,22 @@
1
- # Copyright (c) 2014-2024 Yegor Bugayenko
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', '~> 0.14.1', require: false
25
- gem 'cucumber', '8.0.0', require: false
26
- gem 'minitest', '5.16.2', require: false
27
- gem 'rake', '13.0.6', require: false
28
- gem 'rdoc', '6.4.0', require: false
29
- gem 'rspec-rails', '5.1.2', require: false
30
- gem 'rubocop', '1.60.2', require: false
31
- gem 'rubocop-rspec', '2.22.0', require: false
32
- gem 'simplecov', '0.22.0', require: false
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.2', require: false
35
- gem 'xcop', '0.7.1', require: false
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
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2014-2024 Yegor Bugayenko
3
+ Copyright (c) 2014-2026 Yegor Bugayenko
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the 'Software'), to deal
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
- <img alt="pdd logo" src="https://avatars2.githubusercontent.com/u/24456188" width="92px" height="92px"/>
1
+ # Collector of TODO Puzzles in Source Code
2
2
 
3
3
  [![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)
4
- [![DevOps By Rultor.com](http://www.rultor.com/b/cqfn/pdd)](http://www.rultor.com/p/cqfn/pdd)
4
+ [![DevOps By Rultor.com](https://www.rultor.com/b/cqfn/pdd)](https://www.rultor.com/p/cqfn/pdd)
5
5
  [![We recommend RubyMine](https://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)
6
6
 
7
7
  [![rake](https://github.com/cqfn/pdd/actions/workflows/rake.yml/badge.svg)](https://github.com/cqfn/pdd/actions/workflows/rake.yml)
8
- [![PDD status](http://www.0pdd.com/svg?name=cqfn/pdd)](http://www.0pdd.com/p?name=cqfn/pdd)
8
+ [![PDD status](https://www.0pdd.com/svg?name=cqfn/pdd)](https://www.0pdd.com/p?name=cqfn/pdd)
9
9
  [![codecov](https://codecov.io/gh/yegor256/pdd/branch/master/graph/badge.svg)](https://codecov.io/gh/yegor/pdd)
10
10
  [![Hits-of-Code](https://hitsofcode.com/github/cqfn/pdd)](https://hitsofcode.com/view/github/cqfn/pdd)
11
11
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/cqfn/pdd/blob/master/LICENSE.txt)
12
- [![Gem Version](https://badge.fury.io/rb/pdd.svg)](http://badge.fury.io/rb/pdd)
12
+ [![Gem Version](https://badge.fury.io/rb/pdd.svg)](https://badge.fury.io/rb/pdd)
13
13
  [![Maintainability](https://api.codeclimate.com/v1/badges/c8e46256fdd8ddc817e5/maintainability)](https://codeclimate.com/github/cqfn/pdd/maintainability)
14
- [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg)](http://rubydoc.info/github/cqfn/pdd/master/frames)
14
+ [![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](https://rubydoc.info/github/cqfn/pdd/master/frames)
15
15
  [![Codacy Badge](https://app.codacy.com/project/badge/Grade/1792d42f96fb45448e8d495ebc4348aa)](https://www.codacy.com/gh/cqfn/pdd/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=cqfn/pdd&amp;utm_campaign=Badge_Grade)
16
16
 
17
- Read this article about
18
- [_Puzzle Driven Development_](http://www.yegor256.com/2009/03/04/pdd.html).
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](http://www.0pdd.com): a hosted service,
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+ and [`libmagic`](#how-to-install-libmagic) are installed. Then, install our gem:
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
- $ gem install pdd
30
+ gem install pdd
32
31
  ```
33
32
 
34
33
  Run it locally and read its output:
35
34
 
36
35
  ```bash
37
- $ pdd --help
36
+ pdd --help
38
37
  ```
39
38
 
40
39
  ## Usage
41
40
 
42
- You can exclude & include certain number of files from the search via these options:
41
+ You can exclude & include a certain number of files from the search
42
+ via these options:
43
43
 
44
44
  ```bash
45
- $ pdd --exclude glob
45
+ pdd --exclude glob
46
46
  ```
47
47
 
48
- You can skip any file(s) with a name suffix that matches the pattern glob, using wildcard matching;
49
- a name suffix is either the whole path and name, or reg expr, for example:
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
- $ pdd --exclude src/**/*.java --exclude target/**/*
53
- $ pdd --exclude src/**/*.java # exclude .java files in src/
54
- $ pdd --exclude src/**/* # exclude all files in src/
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
- $ pdd --include glob
61
+ pdd --include glob
61
62
  ```
62
63
 
63
- Search only files whose name matches glob, using wildcard matching as described under ``--exclude``.
64
- If contradictory ``--include`` and ``--exclude`` options are given, the last matching one wins.
65
- If no ``--include`` or ``--exclude`` options are given, all files from working directory are included, example:
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
- $ pdd --include src/**/*.py # include only .py files in src/
69
- $ pdd --include src/**/* # include all files in src/
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
- Full command format is (all parameters are optional):
73
- ```bash
74
- $ pdd [--verbose] [--quiet] [--remove] [--skip-gitignore] [--skip-errors] \
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 (pay attention
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 anount of spaces, as the second line.
121
- * This text will be not a part of the puzzle, as
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](http://www.0pdd.com),
130
- after processing this text, the issue titled
131
- "File.java:10-13: This is something to do later in one of ..." will be created.
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. If your comment is longer
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 will fail to parse puzzles and produce an error with duplicates list.
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. They are `@todo`, `TODO` and `TODO:`.
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**. Possible formats of puzzle markers (it doesn't matter what the
144
- line starts with and where it is located,
145
- as long as you have one of the 3 supported keywords right in front
146
- of the mandatory marker):
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: #TEST-21:30min Puzzle description
140
+ // TODO #TEST-21:30min Puzzle description
154
141
  ```
155
142
 
156
- Here `DES` and `DEV` are the roles of people who must fix that puzzles;
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](http://www.0pdd.com/p?name=yegor256/takes),
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
- - **prefix** - any optional text followed by space before puzzle keyword (todo).
171
- It should be the same for all lines of puzzle description.
172
- - \ symbol can be used to logically divide puzzle description.
173
- prefix should be presented with it.
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 comment should be started and closed by special symbols, then place them in
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 the spaces, as on the first line.
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 backspace to that line
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
- $ pdd --rule min-estimate:60 --rule max-estimate:120
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 [yegor256/0pdd](https://github.com/yegor256/0pdd/blob/master/.pdd).
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](http://www.0pdd.com/snapshot?name=yegor256/takes)):
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
- $ apt install libmagic-dev
272
+ apt install libmagic-dev
283
273
  ```
284
274
 
285
- For Mac:
275
+ For macOS:
286
276
 
287
277
  ```bash
288
- $ brew install libmagic
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 [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
298
- Make sure your build is green before you contribute
299
- your pull request. You will need to have [Ruby](https://www.ruby-lang.org/en/) 2.7+ and
300
- [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:
301
291
 
302
292
  ```bash
303
- $ bundle install
304
- $ bundle exec rake
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
- $ gem install overcommit -v '=0.58.0'
310
- $ overcommit --install
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
- $ ./bin/pdd --help
309
+ ./bin/pdd --help
319
310
  ```
320
311
 
321
312
  To run a single unit test:
322
313
 
323
314
  ```bash
324
- $ bundle exec ruby test/test_many.rb
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