gl_lint 0.3.4 → 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: 49a4e6685b08e1fff3948a885c0be3264552f1b806ff52c6382febc364ab8fb7
4
- data.tar.gz: 57bb7867bee08e7c7ce086f768a8b27558b2b50e2580f941f6b42bf0f8e6655a
3
+ metadata.gz: 0b67203184c873acbd1692015d5ecb418a7082020a40a5d09ede1ce02f9aae07
4
+ data.tar.gz: 3f41ae2254eb5a6506067bac5258eb45eb0568674283230095e4c4e0b2412051
5
5
  SHA512:
6
- metadata.gz: 5e23ec9c1ae8dea124e46f298e1695ea6169f084e770a47f35451da864b8fef7e533a3c6c2db12716c1e31c21801eaca41cfd10b39b3354faab64627b5f65138
7
- data.tar.gz: be1e87ff734d69b4421a9f223dd996c32b24f1e0278a173e259161ca9891f455e1d82ea71a3253d920c7ce07f57c29f2a060d318f48a4d3a3a4493787ba28300
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
@@ -13,7 +13,7 @@ module GlLint
13
13
  # Make certain that schemas are ignored
14
14
  rubocop_files.reject! { |f| f.match?(%r{db/.*schema.rb}) }
15
15
 
16
- prettier_files = selected_files.grep(/\.(js|jsx|json|css|md)\z/)
16
+ prettier_files = selected_files.grep(/\.(js|jsx|json|css)\z/)
17
17
  end
18
18
 
19
19
  { rubocop: rubocop_files, prettier: prettier_files }
@@ -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.4'
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.4
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-07 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