gl_lint 0.3.5 → 0.4.0

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
2
  SHA256:
3
- metadata.gz: eb422c4349f4b70e17c8877ca8982da55b3d5826fef5d3b5a01cdfe99a1084b7
4
- data.tar.gz: 1bb10ab8e411d11ed81953b4ba94996c6a663e9dfff17776b507a7a17ca3d411
3
+ metadata.gz: 0b67203184c873acbd1692015d5ecb418a7082020a40a5d09ede1ce02f9aae07
4
+ data.tar.gz: 3f41ae2254eb5a6506067bac5258eb45eb0568674283230095e4c4e0b2412051
5
5
  SHA512:
6
- metadata.gz: fc51e5343ca6dadcc1038203deefbef12562243e69d2b5a87aed01a7315cda56d2ce7ee67ce0692708d56f999ae6956b3490884dc8a9cc0ed0645070ac2deaa7
7
- data.tar.gz: 24bb3a8cf4081e4e2525819154e4c7e6a23aaad067e7a8b1d175c1775fcad9dc80424e19e662f1c23168f5fcb007af7a5c31e8c2ece4ea9ea19764099f2a04ac
6
+ metadata.gz: 73658f4e4fcd4be83ec30e8496de4afdd85a711cd1a0a7681d836680f088f8396b47a3365d5f2ad20bcbcc1ea0205ab594e0a2b76b4729b2c8a258a94ce79b3c
7
+ data.tar.gz: 9820e9e23397a27f828f7a0598926d8afc1b92d70a87a5f4f650be510cb7791da549351f214a0dff6391d8760748193b0c7cde0dc3eb084643366621cf47d990
data/README.md CHANGED
@@ -31,14 +31,14 @@ Then add this to the file:
31
31
  require 'rubygems'
32
32
  require 'gl_lint'
33
33
 
34
- GlLint.call_cli(app_root: File.expand_path('..', __dir__))
34
+ GLLint.call_cli(app_root: File.expand_path('..', __dir__))
35
35
  ```
36
36
 
37
37
  Then run `bin/lint` to lint your changes
38
38
 
39
- Alternatively, if your project doesn't have JavaScript, add `linters: ['rubocop]`
39
+ Alternatively, if your project doesn't have JavaScript, add `linters: ['rubocop/]`
40
40
 
41
41
  ```ruby
42
- GlLint.call_cli(app_root: File.expand_path('..', __dir__),
42
+ GLLint.call_cli(app_root: File.expand_path('..', __dir__),
43
43
  linters: ['rubocop'])
44
44
  ```
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ require 'rspec/core/rake_task'
2
+ require 'bundler/gem_tasks'
3
+ RSpec::Core::RakeTask.new(:spec)
4
+ task default: :spec
data/gl_lint.gemspec CHANGED
@@ -9,7 +9,7 @@ NON_GEM_FILES = ['Gemfile', 'Gemfile.lock', 'Guardfile', 'bin/lint'].freeze
9
9
 
10
10
  Gem::Specification.new do |spec|
11
11
  spec.name = 'gl_lint'
12
- spec.version = GlLint::VERSION
12
+ spec.version = GLLint::VERSION
13
13
  spec.authors = ['Give Lively']
14
14
  spec.summary = 'Give Lively linter tool'
15
15
  spec.homepage = 'https://github.com/givelively/gl_lint'
data/lib/gl_lint/cli.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'optparse'
2
2
 
3
- module GlLint
3
+ module GLLint
4
4
  class CLI
5
5
  LINTERS = %w[rubocop prettier].freeze
6
6
  DEFAULT_TARGET = '--changed'.freeze
@@ -1,6 +1,6 @@
1
1
  require 'yaml'
2
2
 
3
- module GlLint
3
+ module GLLint
4
4
  class ExportRubocop
5
5
  class << self
6
6
  IGNORED_PROPERTIES = %w[Description Enabled Reference Safe SafeAutoCorrect
@@ -1,4 +1,4 @@
1
- module GlLint
1
+ module GLLint
2
2
  class FileSelector
3
3
  NON_RB_RUBY_FILES = %w[Gemfile Rakefile config.ru
4
4
  bin/bundle bin/lint bin/rubocop bin/setup bin/update].freeze
@@ -1,10 +1,10 @@
1
- module GlLint
1
+ module GLLint
2
2
  class Linter
3
3
  attr_accessor :linter_failures
4
4
 
5
5
  def lint(linters:, target_files:, lint_strategy:, filenames: nil)
6
6
  @linter_failures = []
7
- files = GlLint::FileSelector.files(filenames:, target_files:)
7
+ files = GLLint::FileSelector.files(filenames:, target_files:)
8
8
 
9
9
  lint_ruby_files(linters, target_files, files[:rubocop], lint_strategy)
10
10
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module GlLint
4
- VERSION = '0.3.5'
3
+ module GLLint
4
+ VERSION = '0.4.0'
5
5
  end
data/lib/gl_lint.rb CHANGED
@@ -3,10 +3,10 @@ require 'gl_lint/file_selector'
3
3
  require 'gl_lint/linter'
4
4
  require 'gl_lint/export_rubocop'
5
5
 
6
- module GlLint
6
+ module GLLint
7
7
  class << self
8
8
  def call_cli(app_root:, default_target: nil, linters: nil)
9
- options = GlLint::CLI.parse(app_root:, linters:, default_target:)
9
+ options = GLLint::CLI.parse(app_root:, linters:, default_target:)
10
10
  puts 'Options: ', options, '' if options[:verbose]
11
11
 
12
12
  call(**options.except(:verbose, :default_target))
@@ -17,10 +17,10 @@ module GlLint
17
17
 
18
18
  Dir.chdir(app_root) do
19
19
  if write_rubocop_rules
20
- GlLint::ExportRubocop.write_rules(app_root)
20
+ GLLint::ExportRubocop.write_rules(app_root)
21
21
  else
22
22
  lint_strategy = lint_strategy_from_options(no_fix:, list_only:, unsafe_fix:)
23
- GlLint::Linter.new.lint(linters:, target_files:, filenames:, lint_strategy:)
23
+ GLLint::Linter.new.lint(linters:, target_files:, filenames:, lint_strategy:)
24
24
  end
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gl_lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Give Lively
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-10 00:00:00.000000000 Z
11
+ date: 2024-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: optparse
@@ -89,6 +89,7 @@ extra_rdoc_files:
89
89
  files:
90
90
  - LICENSE
91
91
  - README.md
92
+ - Rakefile
92
93
  - gl_lint.gemspec
93
94
  - lib/gl_lint.rb
94
95
  - lib/gl_lint/cli.rb