nucop 0.2.1 → 0.3.0
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 +4 -4
- data/bin/nucop +1 -1
- data/lib/nucop.rb +3 -3
- data/lib/nucop/cli.rb +4 -2
- data/lib/nucop/formatters/junit_formatter.rb +11 -10
- data/lib/nucop/helpers/factory_bot_helper.rb +1 -1
- data/lib/nucop/version.rb +1 -1
- metadata +9 -9
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: fde4a27e2e094af7f2a2de1d873cea9463b75b2353bde9e05fcd4b75063c42a5
         | 
| 4 | 
            +
              data.tar.gz: c5a4366a50cd466df74cd7f0acbfd20ff8d6176d1f8860ee2d892c063b219ab3
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 5ec9ddc75385fc1c688b466405b9fabb1ed947e7065f4c18f756a818f9b6fb2b3320f4989d175e06267753a839a7082f078c0767e57cad83482dc21fa60d1984
         | 
| 7 | 
            +
              data.tar.gz: d0e634dc581092f4b455ef72dc3520be75e6b152670affb3fb60426bb5e30a5ddcacad74f449df0eed5f2fee821d11e1bebbbce41203c3ffd808d3a81b092366
         | 
    
        data/bin/nucop
    CHANGED
    
    
    
        data/lib/nucop.rb
    CHANGED
    
    | @@ -3,9 +3,9 @@ require "nucop/version" | |
| 3 3 | 
             
            require "rubocop"
         | 
| 4 4 | 
             
            require "git_diff_parser"
         | 
| 5 5 |  | 
| 6 | 
            -
            Dir[File.join(__dir__, "nucop/helpers/**/*.rb")].each { |f| require f }
         | 
| 7 | 
            -
            Dir[File.join(__dir__, "nucop/formatters/**/*.rb")].each { |f| require f }
         | 
| 8 | 
            -
            Dir[File.join(__dir__, "nucop/cops/**/*.rb")].each { |f| require f }
         | 
| 6 | 
            +
            Dir[File.join(__dir__, "nucop/helpers/**/*.rb")].sort.each { |f| require f }
         | 
| 7 | 
            +
            Dir[File.join(__dir__, "nucop/formatters/**/*.rb")].sort.each { |f| require f }
         | 
| 8 | 
            +
            Dir[File.join(__dir__, "nucop/cops/**/*.rb")].sort.each { |f| require f }
         | 
| 9 9 |  | 
| 10 10 | 
             
            module Nucop
         | 
| 11 11 | 
             
            end
         | 
    
        data/lib/nucop/cli.rb
    CHANGED
    
    | @@ -5,7 +5,7 @@ RUBOCOP_DEFAULT_CONFIG_FILE = ".rubocop.yml" | |
| 5 5 | 
             
            CONFIGURATION_FILEPATH = ".nucop.yml"
         | 
| 6 6 |  | 
| 7 7 | 
             
            module Nucop
         | 
| 8 | 
            -
              class  | 
| 8 | 
            +
              class Cli < Thor
         | 
| 9 9 | 
             
                desc "diff_enforced", "run RuboCop on the current diff using only the enforced cops"
         | 
| 10 10 | 
             
                method_option "commit-spec", default: "origin/master", desc: "the commit used to determine the diff."
         | 
| 11 11 | 
             
                method_option "auto-correct", type: :boolean, default: false, desc: "runs RuboCop with auto-correct option"
         | 
| @@ -250,7 +250,9 @@ module Nucop | |
| 250 250 | 
             
                end
         | 
| 251 251 |  | 
| 252 252 | 
             
                def enabled_cops
         | 
| 253 | 
            -
                  YAML.load(`bundle exec rubocop --parallel --show-cops`) | 
| 253 | 
            +
                  YAML.load(`bundle exec rubocop --parallel --show-cops`) # rubocop:disable Security/YAMLLoad
         | 
| 254 | 
            +
                    .select { |_, config| config["Enabled"] }
         | 
| 255 | 
            +
                    .map(&:first)
         | 
| 254 256 | 
             
                end
         | 
| 255 257 |  | 
| 256 258 | 
             
                # Override Thor's options method to include Nucop's options
         | 
| @@ -21,16 +21,17 @@ module Nucop | |
| 21 21 | 
             
                    # One test case per cop per file
         | 
| 22 22 | 
             
                    COPS.each do |cop|
         | 
| 23 23 | 
             
                      cop_offences = offences.select { |offence| offence.cop_name == cop.cop_name }
         | 
| 24 | 
            -
             | 
| 25 | 
            -
             | 
| 26 | 
            -
             | 
| 27 | 
            -
             | 
| 28 | 
            -
             | 
| 29 | 
            -
             | 
| 30 | 
            -
             | 
| 31 | 
            -
             | 
| 32 | 
            -
             | 
| 33 | 
            -
                             | 
| 24 | 
            +
             | 
| 25 | 
            +
                      next if cop_offences.empty?
         | 
| 26 | 
            +
             | 
| 27 | 
            +
                      REXML::Element.new("testcase", @testsuite).tap do |f|
         | 
| 28 | 
            +
                        f.attributes["classname"] = file.gsub(/\.rb\Z/, "").gsub("#{Dir.pwd}/", "").tr("/", ".")
         | 
| 29 | 
            +
                        f.attributes["name"] = "Rubocop: #{cop.cop_name}"
         | 
| 30 | 
            +
                        f.attributes["file"] = cop.cop_name
         | 
| 31 | 
            +
                        cop_offences.each do |offence|
         | 
| 32 | 
            +
                          REXML::Element.new("failure", f).tap do |e|
         | 
| 33 | 
            +
                            e.add_text("#{offence.message}\n\n")
         | 
| 34 | 
            +
                            e.add_text(offence.location.to_s.sub("/usr/src/app/", ""))
         | 
| 34 35 | 
             
                          end
         | 
| 35 36 | 
             
                        end
         | 
| 36 37 | 
             
                      end
         | 
    
        data/lib/nucop/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: nucop
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.3.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Jason Schweier
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2020- | 
| 11 | 
            +
            date: 2020-05-14 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rake
         | 
| @@ -58,14 +58,14 @@ dependencies: | |
| 58 58 | 
             
                requirements:
         | 
| 59 59 | 
             
                - - '='
         | 
| 60 60 | 
             
                  - !ruby/object:Gem::Version
         | 
| 61 | 
            -
                    version: 0. | 
| 61 | 
            +
                    version: 0.83.0
         | 
| 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: 0. | 
| 68 | 
            +
                    version: 0.83.0
         | 
| 69 69 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 70 70 | 
             
              name: rubocop-performance
         | 
| 71 71 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -86,28 +86,28 @@ dependencies: | |
| 86 86 | 
             
                requirements:
         | 
| 87 87 | 
             
                - - '='
         | 
| 88 88 | 
             
                  - !ruby/object:Gem::Version
         | 
| 89 | 
            -
                    version: 2. | 
| 89 | 
            +
                    version: 2.5.2
         | 
| 90 90 | 
             
              type: :runtime
         | 
| 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: 2. | 
| 96 | 
            +
                    version: 2.5.2
         | 
| 97 97 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 98 98 | 
             
              name: rubocop-rspec
         | 
| 99 99 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 100 100 | 
             
                requirements:
         | 
| 101 101 | 
             
                - - '='
         | 
| 102 102 | 
             
                  - !ruby/object:Gem::Version
         | 
| 103 | 
            -
                    version: 1. | 
| 103 | 
            +
                    version: 1.39.0
         | 
| 104 104 | 
             
              type: :runtime
         | 
| 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. | 
| 110 | 
            +
                    version: 1.39.0
         | 
| 111 111 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 112 112 | 
             
              name: ruby-progressbar
         | 
| 113 113 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 171 171 | 
             
                - !ruby/object:Gem::Version
         | 
| 172 172 | 
             
                  version: '0'
         | 
| 173 173 | 
             
            requirements: []
         | 
| 174 | 
            -
            rubygems_version: 3. | 
| 174 | 
            +
            rubygems_version: 3.1.3
         | 
| 175 175 | 
             
            signing_key: 
         | 
| 176 176 | 
             
            specification_version: 4
         | 
| 177 177 | 
             
            summary: Nulogy's implementation of RuboCop, including custom cops and additional
         |