pdd 0.18 → 0.18.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 99bde0870af357f7eba5e562cf4e80367fd5022a
4
- data.tar.gz: 0fc0b88a2e83a2eccb98ed6a5089b469a6d549b7
3
+ metadata.gz: 1a7bf56d2eab1e277c1c717c7c3a9741a085aa1c
4
+ data.tar.gz: 2c0e8a6c70b10a1166ccc01cc2a9723aa888a330
5
5
  SHA512:
6
- metadata.gz: 69b16a076410aec375c78acb4bb01332718edc630541b50c64da84bb92151d9205dddbbce3fe97ef708122fed0d5b832ecf07e1fcef3eb7b6ae61be0f351e146
7
- data.tar.gz: 1685a80e5bf84944218a5211b41f905a7bdccbd8112bf877515518dd79b6ef8f28275f2b6519e86ae52d04428b4a9199369f51b2e8f4d736dedb7ea5b9990982
6
+ metadata.gz: ddc3c2b798ae5f3b1173deaa010de1ae0c9d09abddec69f632cc130b29fe9377cd2007ba01f23186cfb26bfd2b75372b325575714f010f7fc41794e149ba3e69
7
+ data.tar.gz: e7724224e1651202321fbc76eec17fa79ce1fdc964198f4f10376695611d1c7a6321c58b6048f439f19dcbf9bd67923ca61464e331b06a7e78c25c23c1e1d798
@@ -5,3 +5,7 @@
5
5
  * text=auto eol=lf
6
6
  *.java ident
7
7
  *.xml ident
8
+ *.jpg binary
9
+ *.png binary
10
+ *.pdf binary
11
+ *.woff binary
@@ -2,8 +2,6 @@ assets:
2
2
  rubygems.yml: zerocracy/home#assets/rubygems.yml
3
3
  s3cfg: zerocracy/home#assets/s3cfg
4
4
  install: |
5
- sudo apt-get update
6
- sudo apt-get install -y --fix-missing libmagic1 libmagic-dev
7
5
  sudo gem install pdd
8
6
  sudo gem install xcop
9
7
  release:
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <img src="https://avatars2.githubusercontent.com/u/24456188" width="64px" height="64px"/>
2
2
 
3
- [![Managed by Zerocracy](http://www.zerocracy.com/badge.svg)](http://www.zerocracy.com)
3
+ [![Managed by Zerocracy](http://www.0crat.com/badge/C3T46CUJJ.svg)](http://www.0crat.com/p/C3T46CUJJ)
4
4
  [![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/pdd)](http://www.rultor.com/p/yegor256/pdd)
5
5
  [![We recommend RubyMine](http://img.teamed.io/rubymine-recommend.svg)](https://www.jetbrains.com/ruby/)
6
6
 
@@ -62,17 +62,38 @@ void sendEmail() {
62
62
  }
63
63
  ```
64
64
 
65
- It starts with `@todo`, followed by a space and a puzzle marker.
66
- Possible formats of puzzle markers:
65
+ If you use it in combination with [0pdd](http://www.0pdd.com),
66
+ after processing this text, the issue titled
67
+ "File.java:10-13: This is something to do later in one of ..." will be created.
68
+ The specified markers will be included in the issues body
69
+ along with some predefined text. If your comment is longer
70
+ than 40 characters, it will be truncated in the title.
71
+
72
+ It starts with `@todo`, followed by a space and a mandatory puzzle **marker**.
73
+ Possible formats of puzzle markers (it doesn't matter what the
74
+ line starts with and where it is located,
75
+ as long as you have that `@todo` right in front
76
+ of the mandatory marker):
67
77
 
68
78
  ```
69
- #224
70
- #TEST-13
71
- #55:45min
72
- #67/DES
73
- #678:40m/DEV
79
+ // @todo #224
80
+ /* @todo #TEST-13 */
81
+ # @todo #55:45min
82
+ @todo #67/DES
83
+ ;; @todo #678:40m/DEV
74
84
  ```
75
85
 
86
+ Here `DES` and `DEV` are the roles of people who must fix that puzzles;
87
+ `45min` and `40m` is the amount of time the puzzle should take;
88
+ `224`, `TEST-13`, `55`, `67`, and `678` are the IDs of the tickets these
89
+ puzzles are coming from.
90
+
91
+ Markers are absolutely necessary for all puzzles, because they allow
92
+ us to build a hierarchical dependency tree of all puzzles, like
93
+ [this one](http://www.0pdd.com/p?name=yegor256/takes),
94
+ for example. Technically, of course, you can abuse the system
95
+ and put a dummy `#1` marker everywhere.
96
+
76
97
  ## How to Configure Rules?
77
98
 
78
99
  You can specify post-parsing rules for your puzzles, in command line,
@@ -111,7 +132,7 @@ See, how it is done in [yegor256/0pdd](https://github.com/yegor256/0pdd/blob/mas
111
132
 
112
133
  Just submit a pull request. Make sure `rake` passes.
113
134
 
114
- This is how you run it locally to test how it works:
135
+ This is how you run the tool locally to test how it works:
115
136
 
116
137
  ```bash
117
138
  $ ./bin/pdd --help
data/bin/pdd CHANGED
@@ -44,13 +44,15 @@ begin
44
44
  o.bool '-h', '--help', 'Show these instructions'
45
45
  o.bool '-v', '--verbose', 'Enable verbose mode (a lot of logging)'
46
46
  o.bool '-q', '--quiet', 'Enable quiet mode (almost no logging)'
47
+ o.bool '--skip-gitignore', 'Don\'t look into .gitignore for excludes'
47
48
  o.bool '-i', '--version', 'Show current version' do
48
49
  puts PDD::VERSION
49
50
  exit
50
51
  end
51
52
  o.string '-s', '--source', 'Source directory to parse ("." by default)'
52
53
  o.string '-f', '--file', 'File to save XML into'
53
- o.array '-e', '--exclude', 'Glob pattern to exclude, e.g. "**/*.jpg"'
54
+ o.array '-e', '--exclude', 'Glob pattern to exclude, e.g. "**/*.jpg"',
55
+ default: []
54
56
  o.string '-t', '--format', 'Format of the report (xml|html)'
55
57
  o.array(
56
58
  '-r', '--rule', 'Rule to apply (can be used many times)',
@@ -72,6 +74,10 @@ https://github.com/yegor256/pdd/blob/master/README.md"
72
74
  raise '-f is mandatory when using -v, try --help for more information'
73
75
  end
74
76
 
77
+ if opts['skip-gitignore']
78
+ raise 'For --skip-gitignore see https://github.com/yegor256/pdd/issues/80'
79
+ end
80
+
75
81
  Encoding.default_external = Encoding::UTF_8
76
82
  Encoding.default_internal = Encoding::UTF_8
77
83
  file = opts.file? ? File.new(opts[:file], 'w') : STDOUT
@@ -63,6 +63,26 @@ Feature: Command Line Processing
63
63
  Then Exit code is zero
64
64
  And XML file "out.xml" matches "/puzzles[count(puzzle)=0]"
65
65
 
66
+ Scenario: Excluding unnecessary files from gitignore
67
+ Given this step says to skip
68
+ And I have a "a/b/c/test.txt" file with content:
69
+ """
70
+ ~~ @todo #44 some puzzle to be excluded
71
+ """
72
+ And I have a "f/g/h/hello.md" file with content:
73
+ """
74
+ ~~ @todo #44 some puzzle to be excluded as well
75
+ """
76
+ And I have a ".gitignore" file with content:
77
+ """
78
+ # This is the list of patterns
79
+ a/**/*
80
+ !/f
81
+ """
82
+ When I run bin/pdd with "> out.xml"
83
+ Then Exit code is zero
84
+ And XML file "out.xml" matches "/puzzles[count(puzzle)=1]"
85
+
66
86
  Scenario: Rejects unknown options
67
87
  Given I have a "test.txt" file with content:
68
88
  """
@@ -41,9 +41,13 @@ After do
41
41
  FileUtils.rm_rf(@dir) if File.exist?(@dir)
42
42
  end
43
43
 
44
+ Given(/skip/) do
45
+ skip_this_scenario
46
+ end
47
+
44
48
  Given(/^I have a "([^"]*)" file with content:$/) do |file, text|
45
49
  FileUtils.mkdir_p(File.dirname(file)) unless File.exist?(file)
46
- File.open(file, 'w') do |f|
50
+ File.open(file, 'w:ASCII-8BIT') do |f|
47
51
  f.write(text.gsub(/\\xFF/, 0xFF.chr))
48
52
  end
49
53
  end
@@ -36,24 +36,26 @@ module PDD
36
36
  # Fetch all puzzles.
37
37
  def puzzles
38
38
  PDD.log.info "Reading #{@path}..."
39
- re = %r{(.*(?:^|\s))@todo\s+#([\w\-\.:/]+)\s+(.+)}
40
39
  puzzles = []
41
40
  lines = File.readlines(@file)
42
41
  lines.each_with_index do |line, idx|
43
42
  begin
44
- re.match(line) do |match|
43
+ /[^\s]@todo/.match(line) do |_|
44
+ raise Error, '@todo must have a leading space to become a puzzle,
45
+ as this page explains: https://github.com/yegor256/pdd#how-to-format'
46
+ end
47
+ /@todo(?!\s+#)/.match(line) do |_|
48
+ raise Error, "@todo found, but puzzle can't be parsed, \
49
+ most probably because @todo is not followed by a puzzle marker, as this page \
50
+ explains: https://github.com/yegor256/pdd#how-to-format"
51
+ end
52
+ %r{(.*(?:^|\s))@todo\s+#([\w\-\.:/]+)\s+(.+)}.match(line) do |match|
45
53
  puzzles << puzzle(lines.drop(idx + 1), match, idx)
46
54
  end
47
55
  rescue Error, ArgumentError => ex
48
56
  raise Error, "puzzle at line ##{idx + 1}; #{ex.message}"
49
57
  end
50
58
  end
51
- lines.each_with_index do |line, idx|
52
- next unless line =~ /.*(^|\s)@todo\s+[^#]/
53
- raise Error, "@todo found, but puzzle can't be parsed in line ##{idx}, \
54
- most probably because TODO is not followed by a puzzle marker, as this page \
55
- explains: https://github.com/yegor256/pdd#how-to-format"
56
- end
57
59
  puzzles
58
60
  end
59
61
 
@@ -117,6 +119,10 @@ at position ##{prefix.length + 1}."
117
119
  .map { |t| t[1, t.length] }
118
120
  end
119
121
 
122
+ # @todo #75:30min Let's make it possible to fetch Subversion data
123
+ # in a similar way as we are doing with Git. We should also just
124
+ # skip it if it's not SVN.
125
+
120
126
  # Git information at the line
121
127
  def git(pos)
122
128
  dir = Shellwords.escape(File.dirname(@file))
@@ -23,5 +23,5 @@
23
23
  # Copyright:: Copyright (c) 2014-2017 Yegor Bugayenko
24
24
  # License:: MIT
25
25
  module PDD
26
- VERSION = '0.18'.freeze
26
+ VERSION = '0.18.1'.freeze
27
27
  end
@@ -44,13 +44,13 @@ Gem::Specification.new do |s|
44
44
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
45
45
  s.rdoc_options = ['--charset=UTF-8']
46
46
  s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
47
- s.add_runtime_dependency 'nokogiri', '~>1.7'
48
- s.add_runtime_dependency 'slop', '~>4.4'
47
+ s.add_runtime_dependency 'nokogiri', '~>1.8'
48
+ s.add_runtime_dependency 'slop', '~>4.6'
49
49
  s.add_runtime_dependency 'rainbow', '~>2.2'
50
50
  s.add_development_dependency 'rake', '12.0.0'
51
51
  s.add_development_dependency 'codecov', '0.1.10'
52
52
  s.add_development_dependency 'rdoc', '4.2.0'
53
- s.add_development_dependency 'cucumber', '1.3.17'
53
+ s.add_development_dependency 'cucumber', '3.1.0'
54
54
  s.add_development_dependency 'minitest', '5.5.0'
55
55
  s.add_development_dependency 'rubocop', '0.48.1'
56
56
  s.add_development_dependency 'rubocop-rspec', '1.15.1'
@@ -83,7 +83,7 @@ class TestSource < Minitest::Test
83
83
  error = assert_raises PDD::Error do
84
84
  PDD::VerboseSource.new(file, PDD::Source.new(file, 'ff')).puzzles
85
85
  end
86
- assert !error.to_s.index('can\'t be parsed').nil?
86
+ assert !error.to_s.index('@todo is not followed by a puzzle marker').nil?
87
87
  end
88
88
  end
89
89
 
@@ -115,6 +115,22 @@ class TestSource < Minitest::Test
115
115
  end
116
116
  end
117
117
 
118
+ def test_failing_on_puzzle_without_leading_space
119
+ Dir.mktmpdir 'test' do |dir|
120
+ file = File.join(dir, 'hey.txt')
121
+ File.write(
122
+ file,
123
+ '
124
+ *@todo #999 this is an incorrectly formatted puzzle!
125
+ '
126
+ )
127
+ error = assert_raises PDD::Error do
128
+ PDD::VerboseSource.new(file, PDD::Source.new(file, 'x')).puzzles
129
+ end
130
+ assert !error.message.index('@todo must have a leading space').nil?
131
+ end
132
+ end
133
+
118
134
  def test_reads_git_author
119
135
  skip if Gem.win_platform?
120
136
  Dir.mktmpdir 'test' do |dir|
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.18'
4
+ version: 0.18.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: 2017-10-02 00:00:00.000000000 Z
11
+ date: 2017-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.7'
19
+ version: '1.8'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.7'
26
+ version: '1.8'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: slop
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '4.4'
33
+ version: '4.6'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '4.4'
40
+ version: '4.6'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rainbow
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 1.3.17
103
+ version: 3.1.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 1.3.17
110
+ version: 3.1.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: minitest
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -188,7 +188,6 @@ extra_rdoc_files:
188
188
  - LICENSE.txt
189
189
  files:
190
190
  - ".0pdd.yml"
191
- - ".coveralls.yml"
192
191
  - ".gitattributes"
193
192
  - ".gitignore"
194
193
  - ".pdd"
@@ -200,7 +199,6 @@ files:
200
199
  - LICENSE.txt
201
200
  - README.md
202
201
  - Rakefile
203
- - TEAM.md
204
202
  - appveyor.yml
205
203
  - assets/puzzles.xsd
206
204
  - assets/puzzles.xsl
@@ -1,2 +0,0 @@
1
- service_name: travis-pro
2
- repo_token: cZjWSm2veNxj30lzlfMLKXdLQ1XCkKk9H
data/TEAM.md DELETED
@@ -1,17 +0,0 @@
1
- ## Team
2
-
3
- The following members are in the project team:
4
-
5
- Role | Members
6
- ---|---
7
- PM | @davvd
8
- CR |
9
- DEV |
10
- IMP |
11
- ARC |
12
- DES |
13
- PO | @yegor256
14
- ITR |
15
- QA |
16
- SA |
17
- HLP |