lois 0.1.0 → 0.1.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 +5 -5
- data/README.md +21 -7
- data/lib/lois/cli.rb +5 -5
- data/lib/lois/version.rb +1 -1
- data/lois.gemspec +5 -7
- metadata +13 -13
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 | 
            -
             | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 2 | 
            +
            SHA256:
         | 
| 3 | 
            +
              metadata.gz: 3134b8217e71480db050cc301726a341ea8abcf8dc8038e08693a83a76fa7e75
         | 
| 4 | 
            +
              data.tar.gz: '0699f32fc7bb43c5bc1eb476f45da98be8015be2c5345cf3c45fe1b155185c1a'
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: b69ffa3896bdb1c901e8caf3ecbdd241d19272a8eb6a2f6fac09dde4adf55fade76b23e03ae7af343151006952c88ac6c3be4ef84b400b5c58782b6025c4c151
         | 
| 7 | 
            +
              data.tar.gz: ebcb8eb7594da5f78bcccb4a32555f3e98d84e1f4fa0110e8f0fa13192d5f7a664485afc10ec252660e3d015aa3ee273a77f148a207bd3d0b284399455493169
         | 
    
        data/README.md
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            # Lois [](https://circleci.com/gh/ketiko/lois)
         | 
| 2 2 |  | 
| 3 | 
            -
            Lois reports statuses of CI results to  | 
| 3 | 
            +
            Lois reports statuses of CI results to GitHub Pull Request Statuses.
         | 
| 4 4 |  | 
| 5 5 | 
             
            ## Installation
         | 
| 6 6 |  | 
| @@ -32,8 +32,8 @@ Commands: | |
| 32 32 | 
             
              lois simplecov -g, --github-credentials=GITHUB_CREDENTIALS      # Run simplecov
         | 
| 33 33 | 
             
            ```
         | 
| 34 34 |  | 
| 35 | 
            -
            Lois has commands to run and report ruby quality metrics to  | 
| 36 | 
            -
            a  | 
| 35 | 
            +
            Lois has commands to run and report ruby quality metrics to GitHub PR Statuses.  All it requires is
         | 
| 36 | 
            +
            a GitHub basic auth credentials for a user to report the statuses.  The user needs write access to the repo to post
         | 
| 37 37 | 
             
            PR status updates.
         | 
| 38 38 |  | 
| 39 39 | 
             
            See [https://developer.github.com/v3/auth/#basic-authentication](https://developer.github.com/v3/auth/#basic-authentication).
         | 
| @@ -43,30 +43,44 @@ Currently we only support reporting through [CircleCI](https://circleci.com/), b | |
| 43 43 |  | 
| 44 44 | 
             
            Lois will output all the results of the checks to a `lois` directory.  You can add this to your artifact path to view the html representation of the results later.
         | 
| 45 45 |  | 
| 46 | 
            +
            ##### CircleCI 2.0
         | 
| 46 47 | 
             
            A sample `.circleci/config.yml` would look like:
         | 
| 47 48 |  | 
| 48 49 | 
             
            ```
         | 
| 49 50 | 
             
            - run:
         | 
| 50 51 | 
             
                name: Bundler-Audit
         | 
| 51 | 
            -
                command:  | 
| 52 | 
            +
                command: bundle exec lois bundler-audit -g $GITHUB_CREDENTIALS
         | 
| 52 53 |  | 
| 53 54 | 
             
            - run:
         | 
| 54 55 | 
             
                name: Brakeman
         | 
| 55 | 
            -
                command:  | 
| 56 | 
            +
                command: bundle exec lois brakeman -g $GITHUB_CREDENTIALS
         | 
| 56 57 |  | 
| 57 58 | 
             
            - run:
         | 
| 58 59 | 
             
                name: Rubocop
         | 
| 59 | 
            -
                command:  | 
| 60 | 
            +
                command: bundle exec lois rubocop -g $GITHUB_CREDENTIALS
         | 
| 60 61 |  | 
| 61 62 | 
             
            - run:
         | 
| 62 63 | 
             
                name: Reek
         | 
| 63 | 
            -
                command:  | 
| 64 | 
            +
                command: bundle exec lois reek -g $GITHUB_CREDENTIALS
         | 
| 64 65 |  | 
| 65 66 | 
             
            - store_artifacts:
         | 
| 66 67 | 
             
                path: lois
         | 
| 67 68 | 
             
                destination: lois
         | 
| 68 69 | 
             
            ```
         | 
| 69 70 |  | 
| 71 | 
            +
            ##### CircleCI 1.0
         | 
| 72 | 
            +
            A sample `circle.yml` would look like:
         | 
| 73 | 
            +
            ```
         | 
| 74 | 
            +
            test:
         | 
| 75 | 
            +
              pre:
         | 
| 76 | 
            +
                - bundle exec lois bundler-audit -g $GITHUB_CREDENTIALS
         | 
| 77 | 
            +
                - bundle exec lois brakeman -g $GITHUB_CREDENTIALS
         | 
| 78 | 
            +
                - bundle exec lois rubocop -g $GITHUB_CREDENTIALS
         | 
| 79 | 
            +
                - bundle exec lois reek -g $GITHUB_CREDENTIALS
         | 
| 80 | 
            +
              post:
         | 
| 81 | 
            +
                - cp -r lois $CIRCLE_ARTIFACTS/
         | 
| 82 | 
            +
            ```
         | 
| 83 | 
            +
             | 
| 70 84 | 
             
            ### SimpleCov
         | 
| 71 85 |  | 
| 72 86 | 
             
            To get SimpleCov output you must have an `at_exit` hook.  A sample SimpleCov setup looks like:
         | 
    
        data/lib/lois/cli.rb
    CHANGED
    
    | @@ -15,7 +15,7 @@ module Lois | |
| 15 15 | 
             
                  puts 'Checking Rubocop'
         | 
| 16 16 | 
             
                  configure(options)
         | 
| 17 17 |  | 
| 18 | 
            -
                  if system(' | 
| 18 | 
            +
                  if system('rubocop -f html -o lois/rubocop.html -f p')
         | 
| 19 19 | 
             
                    Lois.config.github.success('rubocop', 'Rubocop passed')
         | 
| 20 20 | 
             
                  else
         | 
| 21 21 | 
             
                    Lois.config.github.failure('rubocop', 'Rubocop failed')
         | 
| @@ -35,7 +35,7 @@ module Lois | |
| 35 35 | 
             
                  puts 'Checking bundler-audit'
         | 
| 36 36 | 
             
                  configure(options)
         | 
| 37 37 |  | 
| 38 | 
            -
                  output = `bundle | 
| 38 | 
            +
                  output = `bundle-audit check --verbose --update`
         | 
| 39 39 | 
             
                  result = $CHILD_STATUS
         | 
| 40 40 | 
             
                  File.write('lois/bundler-audit.log', output)
         | 
| 41 41 | 
             
                  puts output
         | 
| @@ -60,8 +60,8 @@ module Lois | |
| 60 60 | 
             
                  puts 'Checking reek'
         | 
| 61 61 | 
             
                  configure(options)
         | 
| 62 62 |  | 
| 63 | 
            -
                  system(' | 
| 64 | 
            -
                  if system(' | 
| 63 | 
            +
                  system('reek -f html > lois/reek.html')
         | 
| 64 | 
            +
                  if system('reek -n --sort-by smelliness')
         | 
| 65 65 | 
             
                    Lois.config.github.success('reek', 'No code smells.')
         | 
| 66 66 | 
             
                  else
         | 
| 67 67 | 
             
                    Lois.config.github.failure('reek', 'Code smells found.')
         | 
| @@ -80,7 +80,7 @@ module Lois | |
| 80 80 | 
             
                def brakeman
         | 
| 81 81 | 
             
                  puts 'Checking brakeman'
         | 
| 82 82 | 
             
                  configure(options)
         | 
| 83 | 
            -
                  if system(' | 
| 83 | 
            +
                  if system('brakeman -o lois/brakeman.html -o /dev/stdout')
         | 
| 84 84 | 
             
                    Lois.config.github.success('brakeman', 'No rails vulnerabilities found.')
         | 
| 85 85 | 
             
                  else
         | 
| 86 86 | 
             
                    Lois.config.github.failure('brakeman', 'Rails vulnerabilities found.')
         | 
    
        data/lib/lois/version.rb
    CHANGED
    
    
    
        data/lois.gemspec
    CHANGED
    
    | @@ -1,5 +1,3 @@ | |
| 1 | 
            -
            # coding: utf-8
         | 
| 2 | 
            -
             | 
| 3 1 | 
             
            lib = File.expand_path('../lib', __FILE__)
         | 
| 4 2 | 
             
            $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
         | 
| 5 3 | 
             
            require 'lois/version'
         | 
| @@ -25,17 +23,17 @@ Gem::Specification.new do |spec| | |
| 25 23 | 
             
              spec.add_development_dependency 'bundler'
         | 
| 26 24 | 
             
              spec.add_development_dependency 'dotenv'
         | 
| 27 25 | 
             
              spec.add_development_dependency 'pry'
         | 
| 26 | 
            +
              spec.add_development_dependency 'pry-byebug'
         | 
| 28 27 | 
             
              spec.add_development_dependency 'rake'
         | 
| 29 28 | 
             
              spec.add_development_dependency 'rspec'
         | 
| 30 29 | 
             
              spec.add_development_dependency 'rspec_junit_formatter'
         | 
| 31 | 
            -
              spec.add_development_dependency 'pry-byebug'
         | 
| 32 30 |  | 
| 33 31 | 
             
              spec.add_dependency 'activesupport'
         | 
| 32 | 
            +
              spec.add_dependency 'brakeman'
         | 
| 33 | 
            +
              spec.add_dependency 'bundler-audit'
         | 
| 34 34 | 
             
              spec.add_dependency 'httparty'
         | 
| 35 | 
            -
              spec.add_dependency 'thor'
         | 
| 36 | 
            -
              spec.add_dependency 'rubocop'
         | 
| 37 35 | 
             
              spec.add_dependency 'reek'
         | 
| 38 | 
            -
              spec.add_dependency ' | 
| 39 | 
            -
              spec.add_dependency 'brakeman'
         | 
| 36 | 
            +
              spec.add_dependency 'rubocop'
         | 
| 40 37 | 
             
              spec.add_dependency 'simplecov'
         | 
| 38 | 
            +
              spec.add_dependency 'thor'
         | 
| 41 39 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: lois
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Ryan Hansen
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2017- | 
| 11 | 
            +
            date: 2017-11-16 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: awesome_print
         | 
| @@ -67,7 +67,7 @@ dependencies: | |
| 67 67 | 
             
                  - !ruby/object:Gem::Version
         | 
| 68 68 | 
             
                    version: '0'
         | 
| 69 69 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 70 | 
            -
              name:  | 
| 70 | 
            +
              name: pry-byebug
         | 
| 71 71 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 72 72 | 
             
                requirements:
         | 
| 73 73 | 
             
                - - ">="
         | 
| @@ -81,7 +81,7 @@ dependencies: | |
| 81 81 | 
             
                  - !ruby/object:Gem::Version
         | 
| 82 82 | 
             
                    version: '0'
         | 
| 83 83 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 84 | 
            -
              name:  | 
| 84 | 
            +
              name: rake
         | 
| 85 85 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 86 86 | 
             
                requirements:
         | 
| 87 87 | 
             
                - - ">="
         | 
| @@ -95,7 +95,7 @@ dependencies: | |
| 95 95 | 
             
                  - !ruby/object:Gem::Version
         | 
| 96 96 | 
             
                    version: '0'
         | 
| 97 97 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 98 | 
            -
              name:  | 
| 98 | 
            +
              name: rspec
         | 
| 99 99 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 100 100 | 
             
                requirements:
         | 
| 101 101 | 
             
                - - ">="
         | 
| @@ -109,7 +109,7 @@ dependencies: | |
| 109 109 | 
             
                  - !ruby/object:Gem::Version
         | 
| 110 110 | 
             
                    version: '0'
         | 
| 111 111 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 112 | 
            -
              name:  | 
| 112 | 
            +
              name: rspec_junit_formatter
         | 
| 113 113 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 114 114 | 
             
                requirements:
         | 
| 115 115 | 
             
                - - ">="
         | 
| @@ -137,7 +137,7 @@ dependencies: | |
| 137 137 | 
             
                  - !ruby/object:Gem::Version
         | 
| 138 138 | 
             
                    version: '0'
         | 
| 139 139 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 140 | 
            -
              name:  | 
| 140 | 
            +
              name: brakeman
         | 
| 141 141 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 142 142 | 
             
                requirements:
         | 
| 143 143 | 
             
                - - ">="
         | 
| @@ -151,7 +151,7 @@ dependencies: | |
| 151 151 | 
             
                  - !ruby/object:Gem::Version
         | 
| 152 152 | 
             
                    version: '0'
         | 
| 153 153 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 154 | 
            -
              name:  | 
| 154 | 
            +
              name: bundler-audit
         | 
| 155 155 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 156 156 | 
             
                requirements:
         | 
| 157 157 | 
             
                - - ">="
         | 
| @@ -165,7 +165,7 @@ dependencies: | |
| 165 165 | 
             
                  - !ruby/object:Gem::Version
         | 
| 166 166 | 
             
                    version: '0'
         | 
| 167 167 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 168 | 
            -
              name:  | 
| 168 | 
            +
              name: httparty
         | 
| 169 169 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 170 170 | 
             
                requirements:
         | 
| 171 171 | 
             
                - - ">="
         | 
| @@ -193,7 +193,7 @@ dependencies: | |
| 193 193 | 
             
                  - !ruby/object:Gem::Version
         | 
| 194 194 | 
             
                    version: '0'
         | 
| 195 195 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 196 | 
            -
              name:  | 
| 196 | 
            +
              name: rubocop
         | 
| 197 197 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 198 198 | 
             
                requirements:
         | 
| 199 199 | 
             
                - - ">="
         | 
| @@ -207,7 +207,7 @@ dependencies: | |
| 207 207 | 
             
                  - !ruby/object:Gem::Version
         | 
| 208 208 | 
             
                    version: '0'
         | 
| 209 209 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 210 | 
            -
              name:  | 
| 210 | 
            +
              name: simplecov
         | 
| 211 211 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 212 212 | 
             
                requirements:
         | 
| 213 213 | 
             
                - - ">="
         | 
| @@ -221,7 +221,7 @@ dependencies: | |
| 221 221 | 
             
                  - !ruby/object:Gem::Version
         | 
| 222 222 | 
             
                    version: '0'
         | 
| 223 223 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 224 | 
            -
              name:  | 
| 224 | 
            +
              name: thor
         | 
| 225 225 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 226 226 | 
             
                requirements:
         | 
| 227 227 | 
             
                - - ">="
         | 
| @@ -288,7 +288,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 288 288 | 
             
                  version: '0'
         | 
| 289 289 | 
             
            requirements: []
         | 
| 290 290 | 
             
            rubyforge_project: 
         | 
| 291 | 
            -
            rubygems_version: 2. | 
| 291 | 
            +
            rubygems_version: 2.7.2
         | 
| 292 292 | 
             
            signing_key: 
         | 
| 293 293 | 
             
            specification_version: 4
         | 
| 294 294 | 
             
            summary: Lois reports statuses of CI results to Github Pull Request Statuses.
         |