gl_lint 0.3.4 → 0.4.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/README.md +3 -3
- data/Rakefile +4 -0
- data/gl_lint.gemspec +1 -1
- data/lib/gl_lint/cli.rb +1 -1
- data/lib/gl_lint/export_rubocop.rb +1 -1
- data/lib/gl_lint/file_selector.rb +2 -2
- data/lib/gl_lint/linter.rb +2 -2
- data/lib/gl_lint/version.rb +2 -2
- data/lib/gl_lint.rb +4 -4
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b67203184c873acbd1692015d5ecb418a7082020a40a5d09ede1ce02f9aae07
|
4
|
+
data.tar.gz: 3f41ae2254eb5a6506067bac5258eb45eb0568674283230095e4c4e0b2412051
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
42
|
+
GLLint.call_cli(app_root: File.expand_path('..', __dir__),
|
43
43
|
linters: ['rubocop'])
|
44
44
|
```
|
data/Rakefile
ADDED
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 =
|
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,4 +1,4 @@
|
|
1
|
-
module
|
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
|
16
|
+
prettier_files = selected_files.grep(/\.(js|jsx|json|css)\z/)
|
17
17
|
end
|
18
18
|
|
19
19
|
{ rubocop: rubocop_files, prettier: prettier_files }
|
data/lib/gl_lint/linter.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
module
|
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 =
|
7
|
+
files = GLLint::FileSelector.files(filenames:, target_files:)
|
8
8
|
|
9
9
|
lint_ruby_files(linters, target_files, files[:rubocop], lint_strategy)
|
10
10
|
|
data/lib/gl_lint/version.rb
CHANGED
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
|
6
|
+
module GLLint
|
7
7
|
class << self
|
8
8
|
def call_cli(app_root:, default_target: nil, linters: nil)
|
9
|
-
options =
|
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
|
-
|
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
|
-
|
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.
|
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-
|
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
|