pmdtester 1.0.0.pre.beta2 → 1.0.0.pre.beta3

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
  SHA256:
3
- metadata.gz: bc98cf9ced82209cfacc2752160229c5eb067c9604c8639d3ec5d9663134d8fc
4
- data.tar.gz: 2c5a013fe96a5e60614f7d932837434a42e15ba19ae5a5e7096934ae4b7692f7
3
+ metadata.gz: 5f7a664829a0e913162fb40f38781976cf9260941e02f535baad1bb2debbe180
4
+ data.tar.gz: f2805406fcccc9c00e3d009817f7fefa82c79cccc5ca1a08317daf4182f089a1
5
5
  SHA512:
6
- metadata.gz: eb72595523c73e2a2a9adfe560f653baf0c35581ee803d3381ef9f400c90aeec9f92ef262f19f6f56323a848a5b4a98fb898af811577c815429a6ac93c619e7e
7
- data.tar.gz: 93d11d0f0943378987968434a6f0a36391830826a70dc6a8ce09a9706aef6cd5cfe87bf31671e7bba031ac52f34c2d26e4edc96f096a5c02f9be19dfd2ce4a82
6
+ metadata.gz: 294c1d8e5eb098d609bfa351612222d7fa7a76002cc43e4ade678cfd74fa1bfac723fa24e0d77ba3b23d084126c3c1aebedf784599be266fd71f318b252f82ef
7
+ data.tar.gz: 25df0d2de24c75a2bd0750d8025fabc0bad1c5d0f2c742eefbfc4884ffc664f1b6c46f7e2477a68daa50c753c0b575dda1b880df9868dd6d31b34c224d6a7882
data/.hoerc ADDED
@@ -0,0 +1 @@
1
+ exclude: !ruby/regexp /tmp$|\.(git|idea)|target|test\/|Gemfile\.lock/
data/.rubocop.yml CHANGED
@@ -8,3 +8,11 @@ AllCops:
8
8
 
9
9
  Metrics/LineLength:
10
10
  Max: 100
11
+
12
+ Metrics/MethodLength:
13
+ Exclude:
14
+ - 'lib/pmdtester/parsers/options.rb'
15
+
16
+ Metrics/BlockLength:
17
+ Exclude:
18
+ - 'lib/pmdtester/parsers/options.rb'
data/.travis.yml CHANGED
@@ -14,7 +14,7 @@ before_deploy:
14
14
  deploy:
15
15
  provider: rubygems
16
16
  api_key:
17
- secure: xcEpX/r7es6/jnvNPrVClVkKLemC+4EaFACfK9PCw05jAqf3sDX8UMKD2B4NU1JfF+I/szC5loyCe8s1wBUbFhelR8sL93RNOyVlQCKqaDTFw0DUvnbKWdgDb7POhcmo8SWi4aaKPias6wCuWA/Wc6jUvcrlAgKDsmYqOukXQoFyQbOUsnqrE/FMA7BfUIHkeeJbNk8807u4+aMqahZyzTFvuEVBUvKqCzDYPl9kpm4fzOtjxiExj1ic9dr2Dz5bcyWteMjZFSgjYWgZUXpk8FWCj5R/8VQsklxFFXFZlQIVwqtpaKgEOjwOOxaA6b8O7OeU82HtSPfxy6eCNE7pvzoYq+ZGxxk6fPbAl2mqKtPU76oRKH8YmXuEdDtdHVCYp7wOFdrLhJ6bJ3H/DSD14Kso21D3ktt4y4qkCd0Ev1a6nbY3LrO+NqFlZytwlYY1t8CUWyc9GfvpQXd7j0shSvrh2RU0+ATcQc0tRSHE2htjbiMWPi/ffMNe5h7iVqho5cLC4n187VrWOqGJf2S47spIgw9N3VWzyfAxAxI2XIvWcGoAIQhEgU6bH14Mz+0amG6ggzCBAbDPEC1j8cuwVkmanWCWZWi6EuRbCYZ7rgCFIx3hZS9NPBANfcXudm7eINvuMlFnmwrVzmtTIEZTy56ZfaWPzGxotyn5M9DdT1U=
17
+ secure: wXntKsCZseVjujUBnEJd0yYYARrBbIcAGACkfvNiUzGhuSN8Vil5ub6TMKu25vIOa+J122atCVMkAGm0g/3vB+h/5RAnMLxGDIWO9FWT2eGX4xtPkA/PbH6ejdJ5UVqUbUu9CTAehAvr6mYCzyBnmkzoyjD2CGaojy7RsvU+5+qeXAxkOhaY0UWgxUWbWwpwRuSt3BmHT+9ri8eEliXCL78yMRNzDLo5DxS6vC/RgrfrQ38mvoHjnniSN85GR2crYqdv40oTng6YZGuRR8FDxIQbu0VRmL/OsHCA1Ltt2m9FOk04EdP30mUsRawyJAB/5RfgVr7thMNd7PdQ9izsMleeg6lPsIW7NWWKoq0ZpImhsXOvWpQQqU4+vcew+QiFL9xthXsvKVs1wulb9y34dwLS7Wj5RInPdSSFtHihissSgBPQlifdK4IKBRw56LZ9OyBSQ7nid5tyvEfRzAWQCl5jrPnILInz2SB0zFtbMvn+699vsWYyn25w/0pGvWS1qhHLakQVLfRM7X8Yz3C5p4mjSwfBoICnN1kwXnezbdHDwbhXACqqN+UWKc1gWuMYQ22vHccUmOuJof4ooFkiZAY+ccwxfmd5TdAX60fkGSgNSn9+hyCarqGG/rU85b+EXpU/Qc7a08cuiIM0X2CVOKFM7E75KDjoi74nS/k0s2E=
18
18
  on:
19
19
  tags: true
20
20
  skip_cleanup: true
data/Gemfile CHANGED
@@ -8,7 +8,6 @@ gem "nokogiri", "~>1.8.2"
8
8
  gem "slop", "~>4.6.2"
9
9
 
10
10
  gem "hoe-bundler", "~>1.2", :group => [:development, :test]
11
- gem "hoe-gemspec", "~>1.0", :group => [:development, :test]
12
11
  gem "hoe-git", "~>1.6", :group => [:development, :test]
13
12
  gem "minitest", "~>5.10.1", :group => [:development, :test]
14
13
  gem "mocha", "~>1.5.0", :group => [:development, :test]
data/History.md CHANGED
@@ -1,3 +1,16 @@
1
+ # 1.0.0.beta3 / 2018-08-01
2
+
3
+ Note: This is a beta release. The pmdtester is feature complete,
4
+ but might contain bugs.
5
+
6
+ ## External Contributions
7
+
8
+ * [#28](https://github.com/pmd/pmd-regression-tester/pull/28): Refactor require statements - [BBG](https://github.com/djydewang)
9
+ * [#29](https://github.com/pmd/pmd-regression-tester/pull/29): Add 'verify' rake task to verify code quality before committing changes - [BBG](https://github.com/djydewang)
10
+ * [#30](https://github.com/pmd/pmd-regression-tester/pull/30): Fix diff_cmd in RuleSetBuilder - [BBG](https://github.com/djydewang)
11
+ * [#31](https://github.com/pmd/pmd-regression-tester/pull/31): Fix color scheme for diff report, add default values for various options - [BBG](https://github.com/djydewang)
12
+ * [#32](https://github.com/pmd/pmd-regression-tester/pull/32): Update Readme.rdoc - [BBG](https://github.com/djydewang)
13
+
1
14
  # 1.0.0.beta2 / 2018-07-17
2
15
 
3
16
  * First release of pmdtester
data/Manifest.txt ADDED
@@ -0,0 +1,36 @@
1
+ .hoerc
2
+ .rubocop.yml
3
+ .rubocop_todo.yml
4
+ .travis.yml
5
+ Gemfile
6
+ History.md
7
+ LICENSE
8
+ Manifest.txt
9
+ README.rdoc
10
+ Rakefile
11
+ bin/pmdtester
12
+ config/all-java.xml
13
+ config/design.xml
14
+ config/project-list.xml
15
+ config/projectlist_1_0_0.xsd
16
+ lib/pmdtester.rb
17
+ lib/pmdtester/builders/diff_builder.rb
18
+ lib/pmdtester/builders/diff_report_builder.rb
19
+ lib/pmdtester/builders/html_report_builder.rb
20
+ lib/pmdtester/builders/pmd_report_builder.rb
21
+ lib/pmdtester/builders/rule_set_builder.rb
22
+ lib/pmdtester/builders/summary_report_builder.rb
23
+ lib/pmdtester/cmd.rb
24
+ lib/pmdtester/parsers/options.rb
25
+ lib/pmdtester/parsers/pmd_report_document.rb
26
+ lib/pmdtester/parsers/projects_parser.rb
27
+ lib/pmdtester/pmd_branch_detail.rb
28
+ lib/pmdtester/pmd_error.rb
29
+ lib/pmdtester/pmd_report_detail.rb
30
+ lib/pmdtester/pmd_violation.rb
31
+ lib/pmdtester/project.rb
32
+ lib/pmdtester/report_diff.rb
33
+ lib/pmdtester/resource_locator.rb
34
+ lib/pmdtester/runner.rb
35
+ resources/css/maven-base.css
36
+ resources/css/maven-theme.css
data/README.rdoc CHANGED
@@ -15,19 +15,92 @@ The diff report can be generated according to the base and patch branch of PMD
15
15
  on a list of standard projects(Spring Framework, Hibernate, Solr, etc.)
16
16
 
17
17
  == SYNOPSIS:
18
-
19
- * FIX (code sample of usage)
18
+ ===Options:
19
+ -r, --local-git-repo path to the local PMD repository
20
+ -b, --base-branch name of the base branch in local PMD repository
21
+ -p, --patch-branch name of the patch branch in local PMD repository
22
+ -bc, --base-config path to the base PMD configuration file default:PMDTESTER_INSTALLED_DIR/config/all-java.xml
23
+ -pc, --patch-config path to the patch PMD configuration file default:PMDTESTER_INSTALLED_DIR/config/all-java.xml
24
+ -c, --config path to the base and patch PMD configuration file
25
+ -l, --list-of-project path to the file which contains the list of standard projects default:PMDTESTER_INSTALLED_DIR/config/project-list.xml
26
+ -m, --mode the mode of the tool: 'local', 'online' or 'single'
27
+ single: Set this option to 'single' if your patch branch contains changes
28
+ for any option that can't work on master/base branch
29
+ online: Set this option to 'online' if you want to download
30
+ the PMD report of master/base branch rather than generating it locally
31
+ local: Default option is 'local', PMD reports for the base and patch branches are generated locally.
32
+
33
+ -f, --html-flag whether to not generate the html diff report in single mode
34
+ -a, --auto-gen-config whether to generate configurations automatically based on branch differences,this option only works in online and local mode
35
+ -d, --debug whether change log level to DEBUG to see more information
36
+ -v, --version
37
+ -h, --help
38
+ === Quick start
39
+ ==== Run local mode
40
+ pmdtester -b master -p YOUR_DEVELOPMENT_BRANCH
41
+ ==== Run single mode
42
+ pmdtester -p YOUR_DEVELOPMENT_BRANCH -pc CONFIG_ONLY_CONTAINS_NEW_PMD_JAVA_RULE -m single
43
+ ==== Run online mode
44
+ pmdtester -b master -p YOUR_DEVELOPMENT_BRANCH -m online
45
+ === Output
46
+ The tool creates the following folders:
47
+ target
48
+ ├── repositories <- the analyzed projects are cloned here
49
+ │ ├── PROJECT_NAME_1
50
+ │ ├── ......
51
+ │ └── PROJECT_NAME_n
52
+ └── reports
53
+ ├── BASE_BRANCH_NAME <- the base baseline is placed here
54
+ ├── PATCH_BRANCH_NAME <- the patch baseline is placed here
55
+ └── diff
56
+ ├── index.xml <- the summary report of diff reports
57
+ ├── base_config.xml <- the resources of the summary report
58
+ ├── patch_config.xml <- the resources fo the summary report
59
+ ├── css <- css reources are placed here
60
+ ├── PROJECT_NAME_1
61
+ └── index.xml <- the diff report of PROJECT_1
62
+ ├── .......
63
+ └── PROJECT_NAME_n
64
+ └── index.xml <- the diff report of PROJECT_N
65
+ ====The baseline format
66
+ branch_name
67
+ ├── branch_info.json
68
+ ├── config.xml
69
+ ├── STANDARD_PROJECT_NAME_1
70
+ │ ├── report_info.json
71
+ │ └── pmd_report.xml
72
+ ├── ......................
73
+ │ ├── report_info.json
74
+ │ └── pmd_report.xml
75
+ └── STANDARD_PROJECT_NAME_n
76
+ ├── report_info.info
77
+ └── pmd_report.xml
20
78
 
21
79
  == REQUIREMENTS:
22
-
23
- * FIX (list of requirements)
24
-
80
+ * Ruby 2.4.1 or higher
81
+ === Runtime dependency
82
+ nokogiri ~> 1.8.2
83
+ slop ~> 4.6.2
84
+ === Development dependency
85
+ hoe ~> 3.17
86
+ hoe-bundler ~> 1.2
87
+ hoe-git ~> 1.6
88
+ minitest ~> 5.10.1
89
+ mocha ~> 1.5.0
90
+ rdoc < 6, >= 4.0
91
+ rubocop ~> 0.56.0
92
+ test-unit ~> 3.2.3
93
+
25
94
  == INSTALL:
26
95
 
27
- * FIX (sudo gem install, anything else)
96
+ gem install pmdtester --pre
28
97
 
29
98
  == DEVELOPERS:
30
-
31
- You can list all tasks by running `rake -T`.
99
+ git clone https://github.com/pmd/pmd-regression-tester.git
100
+ cd pmd-regression-tester
101
+ gem install bundler
102
+ bundle install
103
+ rake verify # run this command before commit your changes
104
+
32
105
 
33
106
 
data/Rakefile CHANGED
@@ -3,31 +3,31 @@
3
3
  # -*- ruby -*-
4
4
  require 'rake/testtask'
5
5
  require 'rubocop/rake_task'
6
- require_relative './lib/pmdtester/parsers/options.rb'
6
+ require_relative 'lib/pmdtester'
7
7
 
8
8
  gem 'hoe'
9
9
  require 'hoe'
10
+
10
11
  Hoe.plugin :bundler
11
- Hoe.plugin :gemspec
12
12
  Hoe.plugin :git
13
13
 
14
14
  hoe = Hoe.spec 'pmdtester' do
15
- self.version = PmdTester::Options::VERSION
15
+ self.version = PmdTester::VERSION
16
16
 
17
17
  developer 'Andreas Dangel', 'andreas.dangel@adangel.org'
18
18
  developer 'Binguo Bao', 'djydewang@gmail.com'
19
19
 
20
- self.clean_globs = %w[target/reports/**/* target/test/**/*]
20
+ self.clean_globs = %w[target/reports/**/* target/test/**/* Gemfile.lock]
21
21
  self.extra_deps += [['nokogiri', '~> 1.8.2'], ['slop', '~> 4.6.2']]
22
22
  self.extra_dev_deps += [
23
23
  ['hoe-bundler', '~> 1.2'],
24
- ['hoe-gemspec', '~> 1.0'],
25
24
  ['hoe-git', '~> 1.6'],
26
25
  ['minitest', '~> 5.10.1'],
27
26
  ['mocha', '~> 1.5.0'],
28
27
  ['rubocop', '~> 0.56.0'],
29
28
  ['test-unit', '~> 3.2.3']
30
29
  ]
30
+ self.spec_extras[:required_rubygems_version] = '>= 2.4.1'
31
31
 
32
32
  license 'BSD-2-Clause'
33
33
  end
@@ -51,4 +51,6 @@ task 'hoe:spec' do
51
51
  File.open("#{hoe.name}.gemspec", "w") { |f| f.write hoe.spec.to_ruby}
52
52
  end
53
53
 
54
+ desc 'verify code quality before committing changes'
55
+ task 'verify' => ['clean', 'test', 'rubocop', 'bundler:gemfile', 'git:manifest']
54
56
  # vim: syntax=ruby
data/bin/pmdtester CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require_relative '../lib/pmdtester/runner'
4
+ require_relative '../lib/pmdtester'
5
5
 
6
6
  runner = PmdTester::Runner.new(ARGV)
7
7
  runner.run
data/lib/pmdtester.rb ADDED
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'logger'
4
+
5
+ require_relative 'pmdtester/cmd'
6
+ require_relative 'pmdtester/pmd_branch_detail'
7
+ require_relative 'pmdtester/pmd_error'
8
+ require_relative 'pmdtester/pmd_report_detail'
9
+ require_relative 'pmdtester/pmd_violation'
10
+ require_relative 'pmdtester/project'
11
+ require_relative 'pmdtester/report_diff'
12
+ require_relative 'pmdtester/resource_locator'
13
+ require_relative 'pmdtester/runner'
14
+
15
+ require_relative 'pmdtester/builders/html_report_builder'
16
+ require_relative 'pmdtester/builders/diff_builder'
17
+ require_relative 'pmdtester/builders/diff_report_builder'
18
+ require_relative 'pmdtester/builders/pmd_report_builder'
19
+ require_relative 'pmdtester/builders/rule_set_builder'
20
+ require_relative 'pmdtester/builders/summary_report_builder'
21
+
22
+ require_relative 'pmdtester/parsers/options'
23
+ require_relative 'pmdtester/parsers/pmd_report_document'
24
+ require_relative 'pmdtester/parsers/projects_parser'
25
+
26
+ # PmdTester is a regression testing tool ensure that new problems
27
+ # and unexpected behaviors will not be introduced to PMD project
28
+ # after fixing an issue and new rules can work as expected.
29
+ module PmdTester
30
+ VERSION = '1.0.0-beta3'
31
+
32
+ def logger
33
+ PmdTester.logger
34
+ end
35
+
36
+ # Global, memoized, lazy initialized instance of a logger
37
+ def self.logger
38
+ @logger ||= Logger.new(STDOUT)
39
+ end
40
+ end
@@ -1,11 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'nokogiri'
4
- require_relative '../pmd_error'
5
- require_relative '../pmd_violation'
6
- require_relative '../pmd_report_detail'
7
- require_relative '../parsers/pmd_report_document'
8
- require_relative '../report_diff'
9
4
 
10
5
  module PmdTester
11
6
  # Building difference between two pmd xml files
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'nokogiri'
4
- require_relative './html_report_builder'
5
4
 
6
5
  module PmdTester
7
6
  # Building diff report for a single project
@@ -74,8 +73,8 @@ module PmdTester
74
73
  def build_summary_row(doc, item, base, patch, diff)
75
74
  doc.tr do
76
75
  doc.td(class: 'c') { doc.text item }
77
- doc.td(class: 'a') { doc.text base }
78
- doc.td(class: 'b') { doc.text patch }
76
+ doc.td(class: 'b') { doc.text base }
77
+ doc.td(class: 'a') { doc.text patch }
79
78
  doc.td(class: 'c') { doc.text diff }
80
79
  end
81
80
  end
@@ -132,7 +131,7 @@ module PmdTester
132
131
  end
133
132
 
134
133
  def build_violation_table_row(doc, key, pmd_violation, a_index)
135
- doc.tr(class: pmd_violation.branch == 'base' ? 'a' : 'b') do
134
+ doc.tr(class: pmd_violation.branch == 'base' ? 'b' : 'a') do
136
135
  # The anchor
137
136
  doc.td do
138
137
  doc.a(id: "A#{a_index}", href: "#A#{a_index}") { doc.text '#' }
@@ -205,7 +204,7 @@ module PmdTester
205
204
  doc.tbody do
206
205
  b_index = 1
207
206
  errors.each do |pmd_error|
208
- doc.tr(class: pmd_error.branch == 'base' ? 'a' : 'b') do
207
+ doc.tr(class: pmd_error.branch == 'base' ? 'b' : 'a') do
209
208
  # The anchor
210
209
  doc.td do
211
210
  doc.a(id: "B#{b_index}", href: "#B#{b_index}") { doc.text '#' }
@@ -1,6 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative '../resource_locator'
4
3
  module PmdTester
5
4
  # This class is the parent of all classes which is used to build html report
6
5
  class HtmlReportBuilder
@@ -1,10 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'fileutils'
4
- require_relative '../cmd'
5
- require_relative '../project'
6
- require_relative '../pmd_branch_detail'
7
- require_relative '../pmd_report_detail'
8
4
 
9
5
  module PmdTester
10
6
  # Building pmd xml reports according to a list of standard
@@ -101,7 +97,7 @@ module PmdTester
101
97
 
102
98
  sum_time = 0
103
99
  @projects.each do |project|
104
- logger.info "Generating #{project.name}'s PMD report'"
100
+ logger.info "Generating #{project.name}'s PMD report"
105
101
  execution_time, end_time =
106
102
  generate_pmd_report(project.local_source_path,
107
103
  project.get_pmd_report_path(@pmd_branch_name))
@@ -2,8 +2,6 @@
2
2
 
3
3
  require 'nokogiri'
4
4
  require 'set'
5
- require_relative '../cmd'
6
- require_relative '../resource_locator'
7
5
 
8
6
  module PmdTester
9
7
  # This class is responsible for generation dynamic configuration
@@ -48,7 +46,7 @@ module PmdTester
48
46
  base = @options.base_branch
49
47
  patch = @options.patch_branch
50
48
  # We only need to support git here, since PMD's repo is using git.
51
- diff_cmd = "git diff --name-only #{base}..#{patch} -- pmd/core pmd/java"
49
+ diff_cmd = "git diff --name-only #{base}..#{patch} -- pmd-core pmd-java"
52
50
  filenames = Cmd.execute(diff_cmd)
53
51
  end
54
52
  filenames.split("\n")
@@ -80,7 +78,7 @@ module PmdTester
80
78
 
81
79
  def build_config_file(rule_sets)
82
80
  if rule_sets.empty?
83
- puts NO_JAVA_RULES_CHANGED_MESSAGE
81
+ logger.info NO_JAVA_RULES_CHANGED_MESSAGE
84
82
  exit 0
85
83
  end
86
84
 
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative './html_report_builder'
4
- require_relative '../pmd_branch_detail'
5
-
6
3
  module PmdTester
7
4
  # Building summary report to show the details about projects and pmd branchs
8
5
  class SummaryReportBuilder < HtmlReportBuilder
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'slop'
4
- require_relative '../pmdtester'
5
4
 
6
5
  module PmdTester
7
6
  class MissRequiredOptionError < StandardError; end
@@ -15,7 +14,8 @@ module PmdTester
15
14
  LOCAL = 'local'
16
15
  ONLINE = 'online'
17
16
  SINGLE = 'single'
18
- VERSION = '1.0.0-beta2'
17
+ DEFAULT_CONFIG_PATH = ResourceLocator.locate('config/all-java.xml')
18
+ DEFAULT_LIST_PATH = ResourceLocator.locate('config/project-list.xml')
19
19
 
20
20
  attr_reader :local_git_repo
21
21
  attr_reader :base_branch
@@ -70,11 +70,14 @@ module PmdTester
70
70
  o.string '-b', '--base-branch', 'name of the base branch in local PMD repository'
71
71
  o.string '-p', '--patch-branch',
72
72
  'name of the patch branch in local PMD repository'
73
- o.string '-bc', '--base-config', 'path to the base PMD configuration file'
74
- o.string '-pc', '--patch-config', 'path to the patch PMD configuration file'
73
+ o.string '-bc', '--base-config', 'path to the base PMD configuration file',
74
+ default: DEFAULT_CONFIG_PATH
75
+ o.string '-pc', '--patch-config', 'path to the patch PMD configuration file',
76
+ default: DEFAULT_CONFIG_PATH
75
77
  o.string '-c', '--config', 'path to the base and patch PMD configuration file'
76
78
  o.string '-l', '--list-of-project',
77
- 'path to the file which contains the list of standard projects'
79
+ 'path to the file which contains the list of standard projects',
80
+ default: DEFAULT_LIST_PATH
78
81
  o.string '-m', '--mode', mode_message, default: 'local'
79
82
  o.bool '-f', '--html-flag',
80
83
  'whether to not generate the html diff report in single mode'
@@ -113,20 +116,17 @@ module PmdTester
113
116
  def check_local_options
114
117
  check_option(LOCAL, 'base branch name', @base_branch)
115
118
  check_option(LOCAL, 'base branch config path', @base_config) unless @auto_config_flag
116
- check_option(LOCAL, 'patch branch name', @patch_branch)
117
119
  check_option(LOCAL, 'patch branch config path', @patch_config) unless @auto_config_flag
118
120
  check_option(LOCAL, 'list of projects file path', @project_list)
119
121
  end
120
122
 
121
123
  def check_single_options
122
- check_option(SINGLE, 'patch branch name', @patch_branch)
123
124
  check_option(SINGLE, 'patch branch config path', @patch_config)
124
125
  check_option(SINGLE, 'list of projects file path', @project_list)
125
126
  end
126
127
 
127
128
  def check_online_options
128
129
  check_option(ONLINE, 'base branch name', @base_branch)
129
- check_option(ONLINE, 'patch branch name', @patch_branch)
130
130
  end
131
131
 
132
132
  def check_common_options
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'nokogiri'
4
- require_relative '../pmd_violation'
5
- require_relative '../pmd_error'
6
4
  module PmdTester
7
5
  # This class is used for registering types of events you are interested in handling.
8
6
  # Also see: https://www.rubydoc.info/github/sparklemotion/nokogiri/Nokogiri/XML/SAX/Document
@@ -1,8 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'nokogiri'
4
- require_relative '../project'
5
- require_relative '../resource_locator'
6
4
 
7
5
  module PmdTester
8
6
  # The ProjectsParser is a class responsible of parsing
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'json'
4
- require_relative './pmd_report_detail'
5
4
 
6
5
  module PmdTester
7
6
  # This class represents all details about branch of pmd
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative './pmd_branch_detail'
4
-
5
3
  module PmdTester
6
4
  # This class represents all the information about the project
7
5
  class Project
@@ -1,15 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative './builders/diff_builder.rb'
4
- require_relative './builders/diff_report_builder.rb'
5
- require_relative './builders/rule_set_builder'
6
- require_relative './builders/summary_report_builder.rb'
7
- require_relative './builders/pmd_report_builder.rb'
8
- require_relative './parsers/options'
9
- require_relative './parsers/projects_parser'
10
- require_relative './pmdtester'
11
- require_relative './pmd_branch_detail'
12
-
13
3
  module PmdTester
14
4
  # The Runner is a class responsible of organizing all PmdTester modules
15
5
  # and running the PmdTester
@@ -28,6 +18,7 @@ module PmdTester
28
18
  when Options::SINGLE
29
19
  run_single_mode
30
20
  end
21
+ introduce_new_pmd_error?
31
22
  end
32
23
 
33
24
  def run_local_mode
@@ -126,5 +117,12 @@ module PmdTester
126
117
  def get_projects(file_path)
127
118
  @projects = ProjectsParser.new.parse(file_path)
128
119
  end
120
+
121
+ def introduce_new_pmd_error?
122
+ @projects.each do |project|
123
+ return true if project.introduce_new_errors?
124
+ end
125
+ false
126
+ end
129
127
  end
130
128
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pmdtester
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.beta2
4
+ version: 1.0.0.pre.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Dangel
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-07-18 00:00:00.000000000 Z
12
+ date: 2018-08-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -53,20 +53,6 @@ dependencies:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
55
  version: '1.2'
56
- - !ruby/object:Gem::Dependency
57
- name: hoe-gemspec
58
- requirement: !ruby/object:Gem::Requirement
59
- requirements:
60
- - - "~>"
61
- - !ruby/object:Gem::Version
62
- version: '1.0'
63
- type: :development
64
- prerelease: false
65
- version_requirements: !ruby/object:Gem::Requirement
66
- requirements:
67
- - - "~>"
68
- - !ruby/object:Gem::Version
69
- version: '1.0'
70
56
  - !ruby/object:Gem::Dependency
71
57
  name: hoe-git
72
58
  requirement: !ruby/object:Gem::Requirement
@@ -182,14 +168,17 @@ executables:
182
168
  extensions: []
183
169
  extra_rdoc_files:
184
170
  - History.md
171
+ - Manifest.txt
185
172
  - README.rdoc
186
173
  files:
174
+ - ".hoerc"
187
175
  - ".rubocop.yml"
188
176
  - ".rubocop_todo.yml"
189
177
  - ".travis.yml"
190
178
  - Gemfile
191
179
  - History.md
192
180
  - LICENSE
181
+ - Manifest.txt
193
182
  - README.rdoc
194
183
  - Rakefile
195
184
  - bin/pmdtester
@@ -197,6 +186,7 @@ files:
197
186
  - config/design.xml
198
187
  - config/project-list.xml
199
188
  - config/projectlist_1_0_0.xsd
189
+ - lib/pmdtester.rb
200
190
  - lib/pmdtester/builders/diff_builder.rb
201
191
  - lib/pmdtester/builders/diff_report_builder.rb
202
192
  - lib/pmdtester/builders/html_report_builder.rb
@@ -211,7 +201,6 @@ files:
211
201
  - lib/pmdtester/pmd_error.rb
212
202
  - lib/pmdtester/pmd_report_detail.rb
213
203
  - lib/pmdtester/pmd_violation.rb
214
- - lib/pmdtester/pmdtester.rb
215
204
  - lib/pmdtester/project.rb
216
205
  - lib/pmdtester/report_diff.rb
217
206
  - lib/pmdtester/resource_locator.rb
@@ -235,9 +224,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
235
224
  version: '0'
236
225
  required_rubygems_version: !ruby/object:Gem::Requirement
237
226
  requirements:
238
- - - ">"
227
+ - - ">="
239
228
  - !ruby/object:Gem::Version
240
- version: 1.3.1
229
+ version: 2.4.1
241
230
  requirements: []
242
231
  rubyforge_project:
243
232
  rubygems_version: 2.7.6
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'logger'
4
-
5
- # PmdTester is a regression testing tool ensure that new problems
6
- # and unexpected behaviors will not be introduced to PMD project
7
- # after fixing an issue , and new rules can work as expected.
8
- module PmdTester
9
- def logger
10
- PmdTester.logger
11
- end
12
-
13
- # Global, memoized, lazy initialized instance of a logger
14
- def self.logger
15
- @logger ||= Logger.new(STDOUT)
16
- end
17
- end