slim_lint 0.18.0 → 0.19.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/config/default.yml +8 -8
- data/lib/slim_lint/cli.rb +19 -12
- data/lib/slim_lint/file_finder.rb +1 -1
- data/lib/slim_lint/linter/control_statement_spacing.rb +0 -1
- data/lib/slim_lint/version.rb +1 -1
- metadata +4 -18
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 9f8981bc153e8cbdd0d0f3be73acfcbbc22cebcc536b5e868e21021551d6b51f
         | 
| 4 | 
            +
              data.tar.gz: 27f4b83491d752017a65c82951ce8edfadd43a41c8ff7cd7b6d6a7ee8790b789
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 69cd8f58ebc3d1950f8ce70a980db280eeaa1887de85dd2f1c5f507fc835b5016693d88bf3d995d82c377a40b210443595c38554485afcb22e96c74b47479d81
         | 
| 7 | 
            +
              data.tar.gz: afc8b85309b1aec3532711b46fdd25c98e662ffa55879e1f295bff3aef96f949ce4ed041b343765a0f5f78de0d0a505704b5a4f93024a46954f0352207d5d3a0
         | 
    
        data/config/default.yml
    CHANGED
    
    | @@ -42,13 +42,14 @@ linters: | |
| 42 42 | 
             
                # WARNING: If you define this list in your own .slim-lint.yml file, you'll
         | 
| 43 43 | 
             
                # be overriding the list defined here.
         | 
| 44 44 | 
             
                ignored_cops:
         | 
| 45 | 
            -
                  - Layout/ | 
| 46 | 
            -
                  - Layout/ | 
| 47 | 
            -
                  - Layout/ | 
| 48 | 
            -
                  - Layout/AlignParameters
         | 
| 45 | 
            +
                  - Layout/ArgumentAlignment
         | 
| 46 | 
            +
                  - Layout/ArrayAlignment
         | 
| 47 | 
            +
                  - Layout/BlockAlignment
         | 
| 49 48 | 
             
                  - Layout/EmptyLineAfterGuardClause
         | 
| 49 | 
            +
                  - Layout/EndAlignment
         | 
| 50 | 
            +
                  - Layout/FirstArrayElementIndentation
         | 
| 50 51 | 
             
                  - Layout/FirstParameterIndentation
         | 
| 51 | 
            -
                  - Layout/ | 
| 52 | 
            +
                  - Layout/HashAlignment
         | 
| 52 53 | 
             
                  - Layout/IndentationConsistency
         | 
| 53 54 | 
             
                  - Layout/IndentationWidth
         | 
| 54 55 | 
             
                  - Layout/InitialIndentation
         | 
| @@ -59,10 +60,9 @@ linters: | |
| 59 60 | 
             
                  - Layout/MultilineMethodCallIndentation
         | 
| 60 61 | 
             
                  - Layout/MultilineMethodDefinitionBraceLayout
         | 
| 61 62 | 
             
                  - Layout/MultilineOperationIndentation
         | 
| 62 | 
            -
                  - Layout/ | 
| 63 | 
            +
                  - Layout/ParameterAlignment
         | 
| 64 | 
            +
                  - Layout/TrailingEmptyLines
         | 
| 63 65 | 
             
                  - Layout/TrailingWhitespace
         | 
| 64 | 
            -
                  - Lint/BlockAlignment
         | 
| 65 | 
            -
                  - Lint/EndAlignment
         | 
| 66 66 | 
             
                  - Lint/Void
         | 
| 67 67 | 
             
                  - Metrics/BlockLength
         | 
| 68 68 | 
             
                  - Metrics/BlockNesting
         | 
    
        data/lib/slim_lint/cli.rb
    CHANGED
    
    | @@ -3,11 +3,18 @@ | |
| 3 3 | 
             
            require 'slim_lint'
         | 
| 4 4 | 
             
            require 'slim_lint/options'
         | 
| 5 5 |  | 
| 6 | 
            -
            require 'sysexits'
         | 
| 7 | 
            -
             | 
| 8 6 | 
             
            module SlimLint
         | 
| 9 7 | 
             
              # Command line application interface.
         | 
| 10 8 | 
             
              class CLI # rubocop:disable Metrics/ClassLength
         | 
| 9 | 
            +
                # Exit codes
         | 
| 10 | 
            +
                # @see https://man.openbsd.org/sysexits.3
         | 
| 11 | 
            +
                EX_OK = 0
         | 
| 12 | 
            +
                EX_USAGE = 64
         | 
| 13 | 
            +
                EX_DATAERR = 65
         | 
| 14 | 
            +
                EX_NOINPUT = 67
         | 
| 15 | 
            +
                EX_SOFTWARE = 70
         | 
| 16 | 
            +
                EX_CONFIG = 78
         | 
| 17 | 
            +
             | 
| 11 18 | 
             
                # Create a CLI that outputs to the specified logger.
         | 
| 12 19 | 
             
                #
         | 
| 13 20 | 
             
                # @param logger [SlimLint::Logger]
         | 
| @@ -39,16 +46,16 @@ module SlimLint | |
| 39 46 |  | 
| 40 47 | 
             
                  if options[:help]
         | 
| 41 48 | 
             
                    print_help(options)
         | 
| 42 | 
            -
                     | 
| 49 | 
            +
                    EX_OK
         | 
| 43 50 | 
             
                  elsif options[:version] || options[:verbose_version]
         | 
| 44 51 | 
             
                    print_version(options)
         | 
| 45 | 
            -
                     | 
| 52 | 
            +
                    EX_OK
         | 
| 46 53 | 
             
                  elsif options[:show_linters]
         | 
| 47 54 | 
             
                    print_available_linters
         | 
| 48 | 
            -
                     | 
| 55 | 
            +
                    EX_OK
         | 
| 49 56 | 
             
                  elsif options[:show_reporters]
         | 
| 50 57 | 
             
                    print_available_reporters
         | 
| 51 | 
            -
                     | 
| 58 | 
            +
                    EX_OK
         | 
| 52 59 | 
             
                  else
         | 
| 53 60 | 
             
                    scan_for_lints(options)
         | 
| 54 61 | 
             
                  end
         | 
| @@ -60,20 +67,20 @@ module SlimLint | |
| 60 67 | 
             
                  case exception
         | 
| 61 68 | 
             
                  when SlimLint::Exceptions::ConfigurationError
         | 
| 62 69 | 
             
                    log.error exception.message
         | 
| 63 | 
            -
                     | 
| 70 | 
            +
                    EX_CONFIG
         | 
| 64 71 | 
             
                  when SlimLint::Exceptions::InvalidCLIOption
         | 
| 65 72 | 
             
                    log.error exception.message
         | 
| 66 73 | 
             
                    log.log "Run `#{APP_NAME}` --help for usage documentation"
         | 
| 67 | 
            -
                     | 
| 74 | 
            +
                    EX_USAGE
         | 
| 68 75 | 
             
                  when SlimLint::Exceptions::InvalidFilePath
         | 
| 69 76 | 
             
                    log.error exception.message
         | 
| 70 | 
            -
                     | 
| 77 | 
            +
                    EX_NOINPUT
         | 
| 71 78 | 
             
                  when SlimLint::Exceptions::NoLintersError
         | 
| 72 79 | 
             
                    log.error exception.message
         | 
| 73 | 
            -
                     | 
| 80 | 
            +
                    EX_NOINPUT
         | 
| 74 81 | 
             
                  else
         | 
| 75 82 | 
             
                    print_unexpected_exception(exception)
         | 
| 76 | 
            -
                     | 
| 83 | 
            +
                    EX_SOFTWARE
         | 
| 77 84 | 
             
                  end
         | 
| 78 85 | 
             
                end
         | 
| 79 86 |  | 
| @@ -83,7 +90,7 @@ module SlimLint | |
| 83 90 | 
             
                def scan_for_lints(options)
         | 
| 84 91 | 
             
                  report = Runner.new.run(options)
         | 
| 85 92 | 
             
                  print_report(report, options)
         | 
| 86 | 
            -
                  report.failed? ?  | 
| 93 | 
            +
                  report.failed? ? EX_DATAERR : EX_OK
         | 
| 87 94 | 
             
                end
         | 
| 88 95 |  | 
| 89 96 | 
             
                # Outputs a report of the linter run using the specified reporter.
         | 
| @@ -38,7 +38,7 @@ module SlimLint | |
| 38 38 | 
             
                #
         | 
| 39 39 | 
             
                # @param patterns [Array<String>]
         | 
| 40 40 | 
             
                # @return [Array<String>]
         | 
| 41 | 
            -
                def extract_files_from(patterns) # rubocop:disable MethodLength
         | 
| 41 | 
            +
                def extract_files_from(patterns) # rubocop:disable Metrics/MethodLength
         | 
| 42 42 | 
             
                  files = []
         | 
| 43 43 |  | 
| 44 44 | 
             
                  patterns.each do |pattern|
         | 
    
        data/lib/slim_lint/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: slim_lint
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.19.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Shane da Silva
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2019- | 
| 11 | 
            +
            date: 2019-12-10 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rubocop
         | 
| @@ -16,14 +16,14 @@ dependencies: | |
| 16 16 | 
             
                requirements:
         | 
| 17 17 | 
             
                - - ">="
         | 
| 18 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version: 0. | 
| 19 | 
            +
                    version: 0.77.0
         | 
| 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: 0. | 
| 26 | 
            +
                    version: 0.77.0
         | 
| 27 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 28 28 | 
             
              name: slim
         | 
| 29 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -44,20 +44,6 @@ dependencies: | |
| 44 44 | 
             
                - - "<"
         | 
| 45 45 | 
             
                  - !ruby/object:Gem::Version
         | 
| 46 46 | 
             
                    version: '5.0'
         | 
| 47 | 
            -
            - !ruby/object:Gem::Dependency
         | 
| 48 | 
            -
              name: sysexits
         | 
| 49 | 
            -
              requirement: !ruby/object:Gem::Requirement
         | 
| 50 | 
            -
                requirements:
         | 
| 51 | 
            -
                - - "~>"
         | 
| 52 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 53 | 
            -
                    version: '1.1'
         | 
| 54 | 
            -
              type: :runtime
         | 
| 55 | 
            -
              prerelease: false
         | 
| 56 | 
            -
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 57 | 
            -
                requirements:
         | 
| 58 | 
            -
                - - "~>"
         | 
| 59 | 
            -
                  - !ruby/object:Gem::Version
         | 
| 60 | 
            -
                    version: '1.1'
         | 
| 61 47 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 62 48 | 
             
              name: rspec
         | 
| 63 49 | 
             
              requirement: !ruby/object:Gem::Requirement
         |