pdd 0.21.0 → 0.21.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -2
- data/CITATION.cff +25 -0
- data/README.md +17 -10
- data/lib/pdd/source.rb +4 -2
- data/lib/pdd/version.rb +1 -1
- data/test/test_source.rb +24 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ef027790e2aa528548fcb97f52632e7740f2a28a9ed7180677bf189ba86b504f
|
4
|
+
data.tar.gz: 2432ac79d70ebb056a6b1338ca52b170e2c7134d14b32d0e8454e34ff86f57ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c91ee447d2b8aefde998e6516fdd1679c845b3a2360f8325a944e0833fe5818f23c7dfb465b0242dabc9828742849220951cbd8e91fc014e9603c78c83e4be8
|
7
|
+
data.tar.gz: 2910617b72caa5ad9b083fd6e1471fd6dcf8bb9e3ccea0ecf3577c5eaa060e4468f0278798cca1e77ce5ad9b77117486d55e5e3d536308c27931dce9dec0c60d
|
data/.rubocop.yml
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
AllCops:
|
2
2
|
Exclude:
|
3
|
-
-
|
3
|
+
- "assets/**/*"
|
4
4
|
DisplayCopNames: true
|
5
5
|
TargetRubyVersion: 2.3
|
6
6
|
|
7
7
|
Layout/EndOfLine:
|
8
8
|
EnforcedStyle: lf
|
9
9
|
Metrics/ClassLength:
|
10
|
-
Max:
|
10
|
+
Max: 360
|
11
11
|
Metrics/LineLength:
|
12
12
|
Max: 90
|
13
13
|
Metrics/MethodLength:
|
data/CITATION.cff
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
cff-version: 1.2.0
|
2
|
+
message: "If you use this software, please cite it as below."
|
3
|
+
authors:
|
4
|
+
- family-names: "Bugayenko"
|
5
|
+
given-names: "Yegor"
|
6
|
+
orcid: "https://orcid.org/0000-0001-6370-0678"
|
7
|
+
- family-names: "Bakare"
|
8
|
+
given-names: "Ayomide"
|
9
|
+
- family-names: "Cheverda"
|
10
|
+
given-names: "Arina"
|
11
|
+
- family-names: "Farina"
|
12
|
+
given-names: "Mirko"
|
13
|
+
- family-names: "Kruglov"
|
14
|
+
given-names: "Artem"
|
15
|
+
- family-names: "Plaksin"
|
16
|
+
given-names: "Yaroslav"
|
17
|
+
- family-names: "Succi"
|
18
|
+
given-names: "Giancarlo"
|
19
|
+
- family-names: "Pedrycz"
|
20
|
+
given-names: "Witold"
|
21
|
+
title: "Automatically Prioritizing and Assigning Tasks from Code Repositories in Puzzle Driven Development"
|
22
|
+
version: 0.21.0
|
23
|
+
doi: 10.1145/3524842.3528512
|
24
|
+
date-released: 2022-05-09
|
25
|
+
url: "https://github.com/cqfn/pdd"
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
<img alt="pdd logo" src="https://avatars2.githubusercontent.com/u/24456188" width="
|
1
|
+
<img alt="pdd logo" src="https://avatars2.githubusercontent.com/u/24456188" width="92px" height="92px"/>
|
2
2
|
|
3
3
|
[![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)
|
4
4
|
[![DevOps By Rultor.com](http://www.rultor.com/b/cqfn/pdd)](http://www.rultor.com/p/cqfn/pdd)
|
@@ -25,7 +25,8 @@ Read
|
|
25
25
|
[_PDD in Action_](http://www.yegor256.com/2017/04/05/pdd-in-action.html)
|
26
26
|
and watch [this webinar](https://www.youtube.com/watch?v=nsYGC2aUwfQ).
|
27
27
|
|
28
|
-
|
28
|
+
You should have [Ruby installed](https://www.ruby-lang.org/en/documentation/installation/).
|
29
|
+
Then, install our gem:
|
29
30
|
|
30
31
|
```bash
|
31
32
|
$ gem install pdd
|
@@ -39,26 +40,32 @@ $ pdd --help
|
|
39
40
|
|
40
41
|
You can exclude & include certain number of files from the search via these options:
|
41
42
|
|
42
|
-
|
43
|
+
```
|
44
|
+
$ pdd --exclude=glob
|
45
|
+
```
|
43
46
|
|
44
47
|
You can skip any file(s) with a name suffix that matches the pattern glob, using wildcard matching;
|
45
48
|
a name suffix is either the whole path and name, or reg expr, for example:
|
46
49
|
|
47
50
|
```bash
|
48
|
-
pdd --exclude=src/**/*.java --exclude=target/**/*
|
49
|
-
pdd --exclude=src/**/*.java # exclude .java files in src/
|
50
|
-
pdd --exclude=src/**/* # exclude all files in src/
|
51
|
+
$ pdd --exclude=src/**/*.java --exclude=target/**/*
|
52
|
+
$ pdd --exclude=src/**/*.java # exclude .java files in src/
|
53
|
+
$ pdd --exclude=src/**/* # exclude all files in src/
|
51
54
|
```
|
52
55
|
|
53
|
-
|
56
|
+
You can include too:
|
57
|
+
|
58
|
+
```
|
59
|
+
$ pdd --include=glob
|
60
|
+
```
|
54
61
|
|
55
62
|
Search only files whose name matches glob, using wildcard matching as described under ``--exclude``.
|
56
63
|
If contradictory ``--include`` and ``--exclude`` options are given, the last matching one wins.
|
57
64
|
If no ``--include`` or ``--exclude`` options are given, all files from working directory are included, example:
|
58
|
-
|
65
|
+
|
59
66
|
```bash
|
60
|
-
pdd --include=src/**/*.py # include only .py files in src/
|
61
|
-
pdd --include=src/**/* # include all files in src/
|
67
|
+
$ pdd --include=src/**/*.py # include only .py files in src/
|
68
|
+
$ pdd --include=src/**/* # include all files in src/
|
62
69
|
```
|
63
70
|
|
64
71
|
## How to Format?
|
data/lib/pdd/source.rb
CHANGED
@@ -104,7 +104,8 @@ see https://github.com/cqfn/pdd#how-to-format"
|
|
104
104
|
|
105
105
|
# Fetch puzzle
|
106
106
|
def puzzle(lines, match, idx)
|
107
|
-
|
107
|
+
col_idx = match[0].length - match[0].lstrip.length
|
108
|
+
tail = tail(lines, match[1], col_idx)
|
108
109
|
body = "#{match[3]} #{tail.join(' ')}".gsub(/\s+/, ' ').strip
|
109
110
|
body = body.chomp('*/-->').strip
|
110
111
|
marker = marker(match[2])
|
@@ -141,8 +142,9 @@ against the rules explained here: https://github.com/cqfn/pdd#how-to-format"
|
|
141
142
|
end
|
142
143
|
|
143
144
|
# Fetch puzzle tail (all lines after the first one)
|
144
|
-
def tail(lines, prefix)
|
145
|
+
def tail(lines, prefix, start)
|
145
146
|
prefix = prefix.rstrip
|
147
|
+
prefix = " #{' ' * start}" if prefix.empty? # fallback to space indentation
|
146
148
|
lines
|
147
149
|
.take_while { |t| match_markers(t).none? && t.start_with?(prefix) }
|
148
150
|
.take_while do |t|
|
data/lib/pdd/version.rb
CHANGED
data/test/test_source.rb
CHANGED
@@ -79,6 +79,30 @@ class TestSource < Minitest::Test
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
+
def test_no_prefix_multiline_puzzle_block
|
83
|
+
Dir.mktmpdir 'test' do |dir|
|
84
|
+
file = File.join(dir, 'a.txt')
|
85
|
+
File.write(
|
86
|
+
file,
|
87
|
+
"
|
88
|
+
<!--
|
89
|
+
\x40todo #01:30min correctly formatted multi-line puzzle, with no
|
90
|
+
comment prefix before todo marker
|
91
|
+
-->
|
92
|
+
"
|
93
|
+
)
|
94
|
+
stub_source_find_github_user(file, 'hey') do |source|
|
95
|
+
PDD.opts = nil
|
96
|
+
assert_equal 1, source.puzzles.size
|
97
|
+
puzzle = source.puzzles.last
|
98
|
+
assert_equal '3-4', puzzle.props[:lines]
|
99
|
+
assert_equal 'correctly formatted multi-line puzzle, with no ' \
|
100
|
+
'comment prefix before todo marker', puzzle.props[:body]
|
101
|
+
assert_equal '01', puzzle.props[:ticket]
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
82
106
|
def test_multiple_puzzles_single_comment_block
|
83
107
|
Dir.mktmpdir 'test' do |dir|
|
84
108
|
file = File.join(dir, 'a.txt')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pdd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.21.
|
4
|
+
version: 0.21.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -241,6 +241,7 @@ files:
|
|
241
241
|
- ".rubocop.yml"
|
242
242
|
- ".rultor.yml"
|
243
243
|
- ".simplecov"
|
244
|
+
- CITATION.cff
|
244
245
|
- Gemfile
|
245
246
|
- LICENSE.txt
|
246
247
|
- README.md
|