xcop 0.5.6 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 01042721d40f4868f1355ca93371d489f1b464c7
4
- data.tar.gz: 6503c87b8e09558e0ca2b4431feee7aca28242d1
2
+ SHA256:
3
+ metadata.gz: d3ee694e170f4e6b044b545eab654e33e001eacff8650c157b6afa0d9316d54c
4
+ data.tar.gz: 908e105cfbfc9c83b8180e96cb103dbbf835cd939f904dda8fdfa25a61172106
5
5
  SHA512:
6
- metadata.gz: ce82cc3f7318a3a0fc66f33159eec3f62432cda9280df83473ff8f32abbe22936fd5806138dd580f5ca24a5009386bbada55ffc47ed99e0097eb6a570f200581
7
- data.tar.gz: eb150e198aa055abbf30b4510be56c0533750c5d8a02bb941b66f63dce59f39b6eb4b0c5c13e48737dbb07a8b6422984275879077612445e271e22ed0ec66d73
6
+ metadata.gz: 6a75b4f22d82154af7c05536da729f7cd46f22ecd30d57ff930c6d799b455b1188c56d8f07a72df49b91c2d4fa99e9b4d671eb2111b6d7bf827aa9ac25ced21f
7
+ data.tar.gz: 1c44700a2f0182614f337f1085faaa60c65a261921eb2078a00c7dcd51431bf00e306cb0eef40b10458e59851769e0d494e7a100d17fea1b92f5557207cc67d4
data/.0pdd.yml CHANGED
@@ -3,3 +3,7 @@ errors:
3
3
  # alerts:
4
4
  # github:
5
5
  # - yegor256
6
+
7
+ tags:
8
+ - pdd
9
+ - bug
@@ -0,0 +1,12 @@
1
+ Make sure the title of the issue explains the problem you are having. Also, the description of the issue must clearly explain what is broken, not what you want us to implement. Go through this checklist and make sure you answer "YES" to all points:
2
+
3
+ - You have all pre-requisites listed in README.md installed
4
+ - You are sure that you are not reporting a duplicate (search all issues)
5
+ - You say "is broken" or "doesn't work" in the title
6
+ - You tell us what you are trying to do
7
+ - You explain the results you are getting
8
+ - You suggest an alternative result you would like to see
9
+
10
+ This article will help you understand what we are looking for: http://www.yegor256.com/2014/11/24/principles-of-bug-tracking.html
11
+
12
+ Thank you for your contribution!
@@ -0,0 +1,11 @@
1
+ Many thanks for your contribution, we truly appreciate it. We will appreciate it even more, if you make sure that you can say "YES" to each point in this short checklist:
2
+
3
+ - You made a small amount of changes (less than 100 lines, less than 10 files)
4
+ - You made changes related to only one bug (create separate PRs for separate problems)
5
+ - You are ready to defend your changes (there will be a code review)
6
+ - You don't touch what you don't understand
7
+ - You ran the build locally and it passed
8
+
9
+ This article will help you understand what we are looking for: http://www.yegor256.com/2015/02/09/serious-code-reviewer.html
10
+
11
+ Thank you for your contribution!
@@ -3,6 +3,7 @@ AllCops:
3
3
  - 'bin/**/*'
4
4
  - 'assets/**/*'
5
5
  DisplayCopNames: true
6
+ TargetRubyVersion: 2.2
6
7
 
7
8
  Metrics/CyclomaticComplexity:
8
9
  Max: 10
@@ -12,3 +13,5 @@ Style/MultilineMethodCallIndentation:
12
13
  Enabled: false
13
14
  Metrics/AbcSize:
14
15
  Enabled: false
16
+ Metrics/BlockLength:
17
+ Max: 50
@@ -1,13 +1,15 @@
1
1
  assets:
2
- rubygems.yml: zerocracy/home#assets/rubygems.yml
3
- s3cfg: zerocracy/home#assets/s3cfg
2
+ rubygems.yml: yegor256/home#assets/rubygems.yml
4
3
  install: |
4
+ export GEM_HOME=~/.ruby
5
+ export GEM_PATH=$GEM_HOME:$GEM_PATH
5
6
  sudo apt-get -y update
6
- sudo gem install pdd
7
+ sudo gem install pdd -v 0.20.5
8
+ bundle install
7
9
  release:
8
10
  script: |-
9
- bundle install
10
- rake
11
+ bundle exec rake
12
+ pdd -f /dev/null
11
13
  rm -rf *.gem
12
14
  sed -i "s/1\.0\.snapshot/${tag}/g" lib/xcop/version.rb
13
15
  git add lib/xcop/version.rb
@@ -15,15 +17,10 @@ release:
15
17
  gem build xcop.gemspec
16
18
  chmod 0600 ../rubygems.yml
17
19
  gem push *.gem --config-file ../rubygems.yml
18
- commanders:
19
- - yegor256
20
- architect:
21
- - yegor256
22
20
  merge:
23
21
  script: |-
24
- bundle install
25
- rake
26
- pdd
22
+ bundle exec rake
23
+ pdd -f /dev/null
27
24
  deploy:
28
25
  script: |-
29
26
  echo "There is nothing to deploy"
data/.simplecov CHANGED
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2020 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -8,6 +8,6 @@ branches:
8
8
  install:
9
9
  - travis_retry bundle update
10
10
  script:
11
- - rake
11
+ - bundle exec rake
12
12
  after_success:
13
13
  - "bash <(curl -s https://codecov.io/bash)"
data/Gemfile CHANGED
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2020 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,6 +1,6 @@
1
1
  (The MIT License)
2
2
 
3
- Copyright (c) 2017 Yegor Bugayenko
3
+ Copyright (c) 2017-2020 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/README.md CHANGED
@@ -1,16 +1,19 @@
1
- [![Managed by Zerocracy](http://www.zerocracy.com/badge.svg)](http://www.zerocracy.com)
1
+ <img src="/logo.svg" width="64px"/>
2
+
3
+ [![EO principles respected here](https://www.elegantobjects.org/badge.svg)](https://www.elegantobjects.org)
4
+ [![Managed by Zerocracy](https://www.0crat.com/badge/C3RFVLU72.svg)](https://www.0crat.com/p/C3RFVLU72)
2
5
  [![DevOps By Rultor.com](http://www.rultor.com/b/yegor256/xcop)](http://www.rultor.com/p/yegor256/xcop)
3
- [![We recommend RubyMine](http://img.teamed.io/rubymine-recommend.svg)](https://www.jetbrains.com/ruby/)
6
+ [![We recommend RubyMine](https://www.elegantobjects.org/rubymine.svg)](https://www.jetbrains.com/ruby/)
4
7
 
5
8
  [![Build Status](https://travis-ci.org/yegor256/xcop.svg)](https://travis-ci.org/yegor256/xcop)
6
9
  [![Build status](https://ci.appveyor.com/api/projects/status/orvfo2qgmd1d7a2i?svg=true)](https://ci.appveyor.com/project/yegor256/xcop)
7
10
  [![PDD status](http://www.0pdd.com/svg?name=yegor256/xcop)](http://www.0pdd.com/p?name=yegor256/xcop)
8
11
  [![Gem Version](https://badge.fury.io/rb/xcop.svg)](http://badge.fury.io/rb/xcop)
9
- [![Dependency Status](https://gemnasium.com/yegor256/xcop.svg)](https://gemnasium.com/yegor256/xcop)
10
- [![Code Climate](http://img.shields.io/codeclimate/github/yegor256/xcop.svg)](https://codeclimate.com/github/yegor256/xcop)
11
- [![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/xcop.svg)](https://codecov.io/github/yegor256/xcop?branch=master)
12
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/yegor256/xcop/blob/master/LICENSE.txt)
12
13
 
13
- ## What this is for?
14
+ [![Maintainability](https://api.codeclimate.com/v1/badges/396ec0584e0a84adc723/maintainability)](https://codeclimate.com/github/yegor256/xcop/maintainability)
15
+ [![Test Coverage](https://img.shields.io/codecov/c/github/yegor256/xcop.svg)](https://codecov.io/github/yegor256/xcop?branch=master)
16
+ [![Hits-of-Code](https://hitsofcode.com/github/yegor256/xcop)](https://hitsofcode.com/view/github/yegor256/xcop)
14
17
 
15
18
  This command line tool validates your XML files for proper formatting.
16
19
  If they are not formatted correctly, it prints the difference and
@@ -18,16 +21,15 @@ returns with an error. You can use it two ways: 1) to fail your build
18
21
  if any X-like files (XML, XSD, XSL, XHTML) are not formatted correctly,
19
22
  and 2) to format them correctly.
20
23
 
21
- ## How to install?
24
+ Read this blog post of mine first:
25
+ [_XCOP—XML Style Checker_](https://www.yegor256.com/2017/08/29/xcop.html).
22
26
 
23
- Install it first:
27
+ Install it first (read below if you can't install it):
24
28
 
25
29
  ```bash
26
30
  $ gem install xcop
27
31
  ```
28
32
 
29
- ## How to run?
30
-
31
33
  Run it locally and read its output:
32
34
 
33
35
  ```bash
@@ -48,7 +50,8 @@ can ask it to "beautify" them, using `--fix` option:
48
50
  $ xcop --fix broken-file.xml
49
51
  ```
50
52
 
51
- To fix all files in the directory you can do:
53
+ To fix all files in the directory you can do
54
+ ([won't work](https://askubuntu.com/questions/343727/) if your file names contain spaces):
52
55
 
53
56
  ```bash
54
57
  $ xcop --fix $(find . -name '*.xml')
@@ -69,6 +72,36 @@ Xcop::RakeTask.new(:xcop) do |task|
69
72
  end
70
73
  ```
71
74
 
75
+ ## How to use as GitHub action?
76
+
77
+ Create new workflow file in repository under `.github/workflows/xcop.yml`:
78
+ ```yaml
79
+ ---
80
+ name: XCOP
81
+ "on":
82
+ # run on push to master events
83
+ push:
84
+ branches:
85
+ - master
86
+ # run on pull requests to master
87
+ pull_request:
88
+ branches:
89
+ - master
90
+ jobs:
91
+ build:
92
+ runs-on: ubuntu-latest
93
+ steps:
94
+ - uses: actions/checkout@v2
95
+ - uses: g4s8/xcop-action@master
96
+ ```
97
+ To customize license location or files pattern use action inputs `license` and `files`:
98
+ ```yaml
99
+ - uses: g4s8/xcop-action@master
100
+ with:
101
+ license: MY_LICENSE.txt
102
+ files: "src/*.xml"
103
+ ```
104
+
72
105
  ## How to use in Maven `pom.xml`?
73
106
 
74
107
  You can integrate it with the help of
@@ -134,30 +167,16 @@ Something like this should work:
134
167
  </project>
135
168
  ```
136
169
 
137
- ## How to contribute?
170
+ ## How to contribute
138
171
 
139
- Just submit a pull request. Make sure `rake` passes.
172
+ Read [these guidelines](https://www.yegor256.com/2014/04/15/github-guidelines.html).
173
+ Make sure you build is green before you contribute
174
+ your pull request. You will need to have [Ruby](https://www.ruby-lang.org/en/) 2.3+ and
175
+ [Bundler](https://bundler.io/) installed. Then:
140
176
 
141
- ## License
142
-
143
- (The MIT License)
144
-
145
- Copyright (c) 2017 Yegor Bugayenko
146
-
147
- Permission is hereby granted, free of charge, to any person obtaining a copy
148
- of this software and associated documentation files (the 'Software'), to deal
149
- in the Software without restriction, including without limitation the rights
150
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
151
- copies of the Software, and to permit persons to whom the Software is
152
- furnished to do so, subject to the following conditions:
153
-
154
- The above copyright notice and this permission notice shall be included in all
155
- copies or substantial portions of the Software.
177
+ ```
178
+ $ bundle update
179
+ $ bundle exec rake
180
+ ```
156
181
 
157
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
158
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
159
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
160
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
161
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
162
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
163
- SOFTWARE.
182
+ If it's clean and you don't see any error messages, submit your pull request.
data/Rakefile CHANGED
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2020 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -33,7 +31,7 @@ def version
33
31
  Gem::Specification.load(Dir['*.gemspec'].first).version
34
32
  end
35
33
 
36
- task default: [:clean, :test, :features, :rubocop, :copyright]
34
+ task default: %i[clean test features rubocop copyright]
37
35
 
38
36
  require 'rake/testtask'
39
37
  desc 'Run all unit tests'
@@ -69,7 +67,7 @@ Cucumber::Rake::Task.new(:'features:html') do |t|
69
67
  end
70
68
 
71
69
  task :copyright do
72
- sh "grep -q -r '#{Date.today.strftime('%Y')}' \
70
+ sh "grep -q -r '2017-#{Date.today.strftime('%Y')}' \
73
71
  --include '*.rb' \
74
72
  --include '*.txt' \
75
73
  --include 'Rakefile' \
data/bin/xcop CHANGED
@@ -1,7 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- # encoding: utf-8
3
- #
4
- # Copyright (c) 2017 Yegor Bugayenko
2
+ # Copyright (c) 2017-2020 Yegor Bugayenko
5
3
  #
6
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
7
5
  # of this software and associated documentation files (the 'Software'), to deal
@@ -28,12 +26,24 @@ require 'nokogiri'
28
26
  require_relative '../lib/xcop'
29
27
  require_relative '../lib/xcop/version'
30
28
 
31
- opts = Slop.parse(ARGV, strict: true, help: true) do |o|
29
+ if Gem::Version.new(Nokogiri::VERSION) < Gem::Version.new('1.8')
30
+ puts "Nokogiri version #{Nokogiri::VERSION} is too old, 1.8+ is required"
31
+ end
32
+
33
+ file_cfg = []
34
+ if File.exist?('.xcop')
35
+ file_cfg += File.open('.xcop').read.gsub(/\s+/, " ").strip.split(/\s/)
36
+ end
37
+
38
+ merged = ARGV + file_cfg
39
+
40
+ opts = Slop.parse(merged, strict: true, help: true) do |o|
32
41
  o.banner = "Usage (#{Xcop::VERSION}): xcop [options] [files...]"
33
42
  o.bool '-h', '--help', 'Show these instructions'
34
43
  o.bool '-q', '--quiet', 'Don\'t print anything if there are no errors'
35
44
  o.bool '--version', 'Show current version'
36
45
  o.bool '--fix', 'Fix all files instead of reporting their problems'
46
+ o.bool '--nocolor', 'Suppress colored output'
37
47
  o.string '--license', 'File name of the boilerplate head license'
38
48
  end
39
49
 
@@ -58,7 +68,7 @@ if opts.fix?
58
68
  end
59
69
  else
60
70
  begin
61
- Xcop::CLI.new(opts.arguments, license).run do |f|
71
+ Xcop::CLI.new(opts.arguments, license, opts.nocolor?).run do |f|
62
72
  puts "#{f} looks good" unless opts.quiet?
63
73
  end
64
74
  rescue StandardError => e
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2020 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -66,11 +64,11 @@ Then(/^Stdout is empty$/) do
66
64
  end
67
65
 
68
66
  Then(/^Exit code is zero$/) do
69
- raise "Non-zero exit code #{@exitstatus}:\n#{@stdout}" unless @exitstatus == 0
67
+ raise "Non-zero exit #{@exitstatus}:\n#{@stdout}" unless @exitstatus.zero?
70
68
  end
71
69
 
72
70
  Then(/^Exit code is not zero$/) do
73
- raise 'Zero exit code' if @exitstatus == 0
71
+ raise 'Zero exit code' if @exitstatus.zero?
74
72
  end
75
73
 
76
74
  When(/^I run bash with "([^"]*)"$/) do |text|
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2020 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2020 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -27,20 +25,21 @@ require_relative 'xcop/version'
27
25
 
28
26
  # Xcop main module.
29
27
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
30
- # Copyright:: Copyright (c) 2017 Yegor Bugayenko
28
+ # Copyright:: Copyright (c) 2017-2020 Yegor Bugayenko
31
29
  # License:: MIT
32
30
  module Xcop
33
31
  # Command line interface.
34
32
  class CLI
35
- def initialize(files, license)
33
+ def initialize(files, license, nocolor = false)
36
34
  @files = files
37
35
  @license = license
36
+ @nocolor = nocolor
38
37
  end
39
38
 
40
39
  def run
41
40
  @files.each do |f|
42
41
  doc = Document.new(f)
43
- diff = doc.diff
42
+ diff = doc.diff(@nocolor)
44
43
  unless diff.empty?
45
44
  puts diff
46
45
  raise "Invalid XML formatting in #{f}"
@@ -74,11 +73,11 @@ module Xcop
74
73
  end
75
74
 
76
75
  # Return the difference, if any (empty string if everything is clean).
77
- def diff
76
+ def diff(nocolor = false)
78
77
  xml = Nokogiri::XML(File.open(@path), &:noblanks)
79
78
  ideal = xml.to_xml(indent: 2)
80
79
  now = File.read(@path)
81
- differ(ideal, now)
80
+ differ(ideal, now, nocolor)
82
81
  end
83
82
 
84
83
  # Return the difference for the license.
@@ -105,10 +104,14 @@ module Xcop
105
104
 
106
105
  private
107
106
 
108
- def differ(ideal, fact)
107
+ def differ(ideal, fact, nocolor = false)
109
108
  return '' if ideal == fact
110
- Differ.format = :color
111
- Differ.diff_by_line(schars(ideal), schars(fact)).to_s
109
+ if nocolor
110
+ Differ.diff_by_line(ideal, fact).to_s
111
+ else
112
+ Differ.format = :color
113
+ Differ.diff_by_line(schars(ideal), schars(fact)).to_s
114
+ end
112
115
  end
113
116
 
114
117
  def schars(text)
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2020 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -26,7 +24,7 @@ require_relative '../xcop'
26
24
 
27
25
  # Xcop rake task.
28
26
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
29
- # Copyright:: Copyright (c) 2017 Yegor Bugayenko
27
+ # Copyright:: Copyright (c) 2017-2020 Yegor Bugayenko
30
28
  # License:: MIT
31
29
  module Xcop
32
30
  # Rake task.
@@ -40,7 +38,7 @@ module Xcop
40
38
 
41
39
  def initialize(*args, &task_block)
42
40
  @name = args.shift || :xcop
43
- @includes = %w(xml xsd xhtml xsl html).map { |e| "**/*.#{e}" }
41
+ @includes = %w[xml xsd xhtml xsl html].map { |e| "**/*.#{e}" }
44
42
  @excludes = []
45
43
  @license = nil
46
44
  @quiet = false
@@ -68,8 +66,9 @@ module Xcop
68
66
  rescue StandardError => e
69
67
  abort(e.message)
70
68
  end
69
+ return if @quiet
71
70
  puts "\n#{pluralize(good.length, 'file')} checked, \
72
- everything looks #{Rainbow('pretty').green}" unless @quiet
71
+ everything looks #{Rainbow('pretty').green}"
73
72
  end
74
73
 
75
74
  def pluralize(num, text)
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2020 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -22,8 +20,8 @@
22
20
 
23
21
  # Xcop main module.
24
22
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
25
- # Copyright:: Copyright (c) 2017 Yegor Bugayenko
23
+ # Copyright:: Copyright (c) 2017-2020 Yegor Bugayenko
26
24
  # License:: MIT
27
25
  module Xcop
28
- VERSION = '0.5.6'.freeze
26
+ VERSION = '0.6.2'.freeze
29
27
  end
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="314px" height="314px" viewBox="0 0 314 314" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 43.2 (39069) - http://www.bohemiancoding.com/sketch -->
4
+ <title>Group 2</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs></defs>
7
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
8
+ <g id="Group-2">
9
+ <g id="Group">
10
+ <circle id="Oval" fill="#053C5E" cx="157" cy="157" r="157"></circle>
11
+ <rect id="Rectangle" fill="#2B2B2B" x="0" y="233" width="184" height="69"></rect>
12
+ <text id="xcop" font-family="CourierNewPS-BoldMT, Courier New" font-size="60" font-weight="bold" fill="#FFFFFF">
13
+ <tspan x="20.4882812" y="281">xcop</tspan>
14
+ </text>
15
+ <path d="M135.676765,111.215287 C135.211714,113.540467 132.770932,120.688823 130.252813,127.100603 C127.734621,133.512383 125.2898,140.431445 124.819828,142.476214 C123.6868,147.405663 121.517836,147.185477 119.69487,141.95608 C116.899865,133.938362 105.171362,111.043501 103.859129,111.043501 C100.420089,111.043501 101.508757,114.986149 109.1771,130.30227 C113.739327,139.414532 118.032086,147.448041 118.716515,148.15443 C120.694817,150.196115 120.172626,154.319657 117.358599,158.877992 C113.567467,165.019055 107.570942,183.721189 108.054206,187.896804 C108.804956,194.383204 112.436054,192.210274 113.355359,184.724515 C114.48376,175.535577 120.945556,159.641154 124.897459,156.333653 C127.109021,154.482778 128.268636,151.905536 128.573284,148.163978 C128.818001,145.157747 131.906711,135.560972 135.437115,126.837819 C138.96752,118.114666 141.511492,110.079835 141.090434,108.982574 C139.755727,105.504315 136.554941,106.824333 135.676765,111.215287 M174.714659,126.841564 C169.37392,129.699438 169.197653,130.049915 167.452978,141.283475 C165.577352,153.360398 165.225112,168.513913 166.548289,180.203784 L167.566817,189.202501 L161.346213,191.9541 C154.601949,194.937416 150.91195,200.302465 153.156708,203.861146 C155.104824,206.949562 157.09025,206.70198 157.571826,203.310532 C158.083734,199.706169 166.097413,193.204052 170.29418,192.987978 C172.116999,192.894116 173.522874,191.717021 173.97823,189.903529 C174.383277,188.290613 177.740353,184.944554 181.438431,182.467858 C188.546172,177.707551 194.317883,170.450278 194.317883,166.273341 C194.317883,162.684548 189.493165,158.361603 185.487795,158.361603 C180.701636,158.361603 180.027195,155.239403 183.731222,150.229385 C188.308065,144.038966 188.284856,130.867646 183.690534,127.147387 C179.896537,124.075276 179.885006,124.074836 174.714659,126.841564 M182.67318,134.240439 C184.752542,140.153164 174.808961,161.185104 171.588639,157.68562 C169.868715,155.81653 172.863122,135.012708 175.266374,132.134564 C177.872553,129.013319 181.163896,129.949075 182.67318,134.240439 M184.854262,162.269586 C190.589839,163.855621 189.673839,167.881335 181.645765,176.371155 C177.281618,180.986262 173.904933,183.573859 173.371946,182.711474 C172.876636,181.91012 172.127869,176.711937 171.707987,171.159972 L170.944531,161.065463 L176.209475,161.200234 C179.105172,161.274339 182.995308,161.755548 184.854262,162.269586 M132.642184,172.492256 C131.593837,175.224098 133.152917,177.288844 136.264027,177.288844 C139.014965,177.288844 139.431396,176.221769 138.067531,172.667568 C137.039234,169.987871 133.645289,169.878218 132.642184,172.492256 M203.781503,185.840798 C203.781503,187.657595 209.264724,193.512152 210.966361,193.512152 C212.534035,193.512152 211.991059,187.391138 210.270768,185.670847 C208.092403,183.492409 203.781503,183.605293 203.781503,185.840798" id="Fill-6" fill="#427B8A" fill-rule="nonzero"></path>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </svg>
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2020 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2020 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -27,7 +25,7 @@ require_relative '../lib/xcop/rake_task'
27
25
 
28
26
  # Xcop rake task.
29
27
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
30
- # Copyright:: Copyright (c) 2017 Yegor Bugayenko
28
+ # Copyright:: Copyright (c) 2017-2020 Yegor Bugayenko
31
29
  # License:: MIT
32
30
  class TestRakeTask < Minitest::Test
33
31
  def test_basic
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2020 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -28,7 +26,7 @@ require_relative '../lib/xcop'
28
26
 
29
27
  # Xcop main module test.
30
28
  # Author:: Yegor Bugayenko (yegor256@gmail.com)
31
- # Copyright:: Copyright (c) 2017 Yegor Bugayenko
29
+ # Copyright:: Copyright (c) 2017-2020 Yegor Bugayenko
32
30
  # License:: MIT
33
31
  class TestXcop < Minitest::Test
34
32
  def test_basic
@@ -50,14 +48,14 @@ class TestXcop < Minitest::Test
50
48
  def test_license_presence
51
49
  Dir.mktmpdir 'test2' do |dir|
52
50
  f = File.join(dir, 'a.xml')
53
- license = "Copyright (c) All Good People\nDon't touch it!\n\n"
51
+ license = " Copyright (c) All Good People\n Don't touch it!\n\n"
54
52
  File.write(
55
53
  f,
56
54
  [
57
55
  '<?xml version="1.0"?>',
58
56
  '<!--',
59
- 'Copyright (c) All Good People',
60
- 'Don\'t touch it!',
57
+ ' Copyright (c) All Good People',
58
+ ' Don\'t touch it!',
61
59
  '-->',
62
60
  '<hello>Dude!</hello>',
63
61
  ''
@@ -86,7 +84,7 @@ class TestXcop < Minitest::Test
86
84
  def test_fixes_document
87
85
  Dir.mktmpdir 'test3' do |dir|
88
86
  f = File.join(dir, 'bad.xml')
89
- license = "Copyright (c) Me, Myself, and I\nLike it?\n\n"
87
+ license = " Copyright (c) Me, Myself, and I\n Like it?\n\n"
90
88
  File.write(f, '<hello>My friend!</hello>')
91
89
  Xcop::Document.new(f).fix(license)
92
90
  assert_equal(Xcop::Document.new(f).diff, '')
@@ -1,6 +1,4 @@
1
- # encoding: utf-8
2
- #
3
- # Copyright (c) 2017 Yegor Bugayenko
1
+ # Copyright (c) 2017-2020 Yegor Bugayenko
4
2
  #
5
3
  # Permission is hereby granted, free of charge, to any person obtaining a copy
6
4
  # of this software and associated documentation files (the 'Software'), to deal
@@ -31,8 +29,8 @@ Gem::Specification.new do |s|
31
29
  if s.respond_to? :required_rubygems_version=
32
30
  s.required_rubygems_version = Gem::Requirement.new('>= 0')
33
31
  end
34
- s.rubygems_version = '2.2.2'
35
- s.required_ruby_version = '>= 1.9.3'
32
+ s.rubygems_version = '2.2'
33
+ s.required_ruby_version = '>= 2.2'
36
34
  s.name = 'xcop'
37
35
  s.version = Xcop::VERSION
38
36
  s.license = 'MIT'
@@ -46,16 +44,15 @@ Gem::Specification.new do |s|
46
44
  s.test_files = s.files.grep(%r{^(test|spec|features)/})
47
45
  s.rdoc_options = ['--charset=UTF-8']
48
46
  s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
49
- s.add_runtime_dependency 'nokogiri', '~>1.8'
50
47
  s.add_runtime_dependency 'differ', '~>0.1.2'
48
+ s.add_runtime_dependency 'nokogiri', '~>1.10'
49
+ s.add_runtime_dependency 'rainbow', '~>3.0'
51
50
  s.add_runtime_dependency 'slop', '~>4.4'
52
- s.add_runtime_dependency 'rainbow', '~>2.2'
53
- s.add_development_dependency 'rake', '12.0.0'
54
- s.add_development_dependency 'codecov', '0.1.10'
55
- s.add_development_dependency 'rdoc', '4.2.0'
56
- s.add_development_dependency 'cucumber', '1.3.17'
57
- s.add_development_dependency 'minitest', '5.5.0'
58
- s.add_development_dependency 'rubocop', '0.41.2'
51
+ s.add_development_dependency 'codecov', '0.2.12'
52
+ s.add_development_dependency 'cucumber', '5.2.0'
53
+ s.add_development_dependency 'minitest', '5.14.2'
54
+ s.add_development_dependency 'rake', '13.0.1'
55
+ s.add_development_dependency 'rdoc', '6.2.1'
56
+ s.add_development_dependency 'rubocop', '0.52.0'
59
57
  s.add_development_dependency 'rubocop-rspec', '1.5.1'
60
- s.add_development_dependency 'rspec-rails', '3.1.0'
61
58
  end
metadata CHANGED
@@ -1,155 +1,155 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.6.2
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-09-27 00:00:00.000000000 Z
11
+ date: 2020-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: nokogiri
14
+ name: differ
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.8'
19
+ version: 0.1.2
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.8'
26
+ version: 0.1.2
27
27
  - !ruby/object:Gem::Dependency
28
- name: differ
28
+ name: nokogiri
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.1.2
33
+ version: '1.10'
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: 0.1.2
40
+ version: '1.10'
41
41
  - !ruby/object:Gem::Dependency
42
- name: slop
42
+ name: rainbow
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '4.4'
47
+ version: '3.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '4.4'
54
+ version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rainbow
56
+ name: slop
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '2.2'
61
+ version: '4.4'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '2.2'
68
+ version: '4.4'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rake
70
+ name: codecov
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 12.0.0
75
+ version: 0.2.12
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 12.0.0
82
+ version: 0.2.12
83
83
  - !ruby/object:Gem::Dependency
84
- name: codecov
84
+ name: cucumber
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 0.1.10
89
+ version: 5.2.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 0.1.10
96
+ version: 5.2.0
97
97
  - !ruby/object:Gem::Dependency
98
- name: rdoc
98
+ name: minitest
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 4.2.0
103
+ version: 5.14.2
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: 4.2.0
110
+ version: 5.14.2
111
111
  - !ruby/object:Gem::Dependency
112
- name: cucumber
112
+ name: rake
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - '='
116
116
  - !ruby/object:Gem::Version
117
- version: 1.3.17
117
+ version: 13.0.1
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - '='
123
123
  - !ruby/object:Gem::Version
124
- version: 1.3.17
124
+ version: 13.0.1
125
125
  - !ruby/object:Gem::Dependency
126
- name: minitest
126
+ name: rdoc
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - '='
130
130
  - !ruby/object:Gem::Version
131
- version: 5.5.0
131
+ version: 6.2.1
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - '='
137
137
  - !ruby/object:Gem::Version
138
- version: 5.5.0
138
+ version: 6.2.1
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rubocop
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: 0.41.2
145
+ version: 0.52.0
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - '='
151
151
  - !ruby/object:Gem::Version
152
- version: 0.41.2
152
+ version: 0.52.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rubocop-rspec
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -164,20 +164,6 @@ dependencies:
164
164
  - - '='
165
165
  - !ruby/object:Gem::Version
166
166
  version: 1.5.1
167
- - !ruby/object:Gem::Dependency
168
- name: rspec-rails
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - '='
172
- - !ruby/object:Gem::Version
173
- version: 3.1.0
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - '='
179
- - !ruby/object:Gem::Version
180
- version: 3.1.0
181
167
  description: Validates XML-like documents for proper formatting
182
168
  email: yegor256@gmail.com
183
169
  executables:
@@ -189,6 +175,8 @@ extra_rdoc_files:
189
175
  files:
190
176
  - ".0pdd.yml"
191
177
  - ".gitattributes"
178
+ - ".github/ISSUE_TEMPLATE.md"
179
+ - ".github/PULL_REQUEST_TEMPLATE.md"
192
180
  - ".gitignore"
193
181
  - ".pdd"
194
182
  - ".rubocop.yml"
@@ -210,6 +198,7 @@ files:
210
198
  - lib/xcop.rb
211
199
  - lib/xcop/rake_task.rb
212
200
  - lib/xcop/version.rb
201
+ - logo.svg
213
202
  - test/test__helper.rb
214
203
  - test/test_rake_task.rb
215
204
  - test/test_xcop.rb
@@ -227,15 +216,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
227
216
  requirements:
228
217
  - - ">="
229
218
  - !ruby/object:Gem::Version
230
- version: 1.9.3
219
+ version: '2.2'
231
220
  required_rubygems_version: !ruby/object:Gem::Requirement
232
221
  requirements:
233
222
  - - ">="
234
223
  - !ruby/object:Gem::Version
235
224
  version: '0'
236
225
  requirements: []
237
- rubyforge_project:
238
- rubygems_version: 2.6.8
226
+ rubygems_version: 3.0.1
239
227
  signing_key:
240
228
  specification_version: 2
241
229
  summary: XML Formatting Static Validator