rails-lint 1.0.3 → 1.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93725a44115d5e0f657924173576de78eb5ba2a281bafc13d6264f3cbab28272
4
- data.tar.gz: 48569ed810efa4393e1b812b6c8193d283711352bf0176f2a797bb8024da19bf
3
+ metadata.gz: eedf4994903044e1ec106ebcfdf0a9591e8e00c90d35ae1fdb66ecae7fc4191e
4
+ data.tar.gz: b71db78623c0337426df299df8016988150546a1f677610b5a38c38ba5ba3b22
5
5
  SHA512:
6
- metadata.gz: 07cf28b2883cf81dfa5498ea0de461ad54af1f7979b05c1678cbe6aef080b93f795cd6e8336e8ff63ba87840094f11a09d7842eecc53afcb8b633f26481d47ac
7
- data.tar.gz: 4a56408fa9294e2818f4571e74917c1f8cffd8c4297e66a4e767a75f3b58468b9bdb1322a0ff55512bd95d7b6730f9ba53e81cebbbd1c170df9e733618c3d2b4
6
+ metadata.gz: 49e9695fd1f196e059f4f1596db5b8c331ac1dc98f80d4b1a930bb42ae3915c02f0f9a559b95a7d482c9b30116420c870a5b551c33e01a2146f734b26a72323f
7
+ data.tar.gz: addd772115f11b1387b6a16fd93df54cbc631af22527a8b52271ab6939398d338708fb7f40988502f42679daa124dc34ae23a000ea4992341eb473de7d7361a3
data/.erb-lint.yml CHANGED
@@ -3,12 +3,11 @@ EnableDefaultLinters: true
3
3
  linters:
4
4
  ErbSafety:
5
5
  enabled: true
6
- better_html_config: .better-html.yml
7
6
  Rubocop:
8
7
  enabled: true
9
8
  rubocop_config:
10
- inherit_from:
11
- - .rubocop.yml
9
+ inherit_gem:
10
+ rails-lint: .rubocop.yml
12
11
  Layout/InitialIndentation:
13
12
  Enabled: false
14
13
  Layout/LineLength:
@@ -21,5 +20,5 @@ linters:
21
20
  Enabled: false
22
21
  Style/FrozenStringLiteralComment:
23
22
  Enabled: false
24
- Rails/OutputSafety:
23
+ Lint/UselessAssignment:
25
24
  Enabled: false
data/.rubocop.yml CHANGED
@@ -1,3 +1,20 @@
1
1
  inherit_gem:
2
2
  rubocop-ruby:
3
3
  - .rubocop.yml
4
+
5
+ AllCops:
6
+ NewCops: enable
7
+ Exclude:
8
+ - 'vendor/**/*'
9
+ - 'test/fixtures/**/*'
10
+ - 'db/**/*'
11
+ - 'bin/**/*'
12
+ - 'log/**/*'
13
+ - 'tmp/**/*'
14
+ - 'app/views/**/*'
15
+ - 'config/environments/*'
16
+ - 'node_modules/**/*'
17
+ - '.pryrc'
18
+
19
+ Style/Documentation:
20
+ Enabled: false
data/Gemfile CHANGED
@@ -6,3 +6,5 @@ source "https://rubygems.org"
6
6
  gemspec
7
7
 
8
8
  gem "rake", "~> 13.0"
9
+
10
+ gem "rubocop-ruby", path: "../rubocop-ruby"
data/Gemfile.lock CHANGED
@@ -1,7 +1,15 @@
1
+ PATH
2
+ remote: ../rubocop-ruby
3
+ specs:
4
+ rubocop-ruby (1.0.1)
5
+ rubocop (~> 1.44.1)
6
+ rubocop-performance
7
+ rubocop-rspec
8
+
1
9
  PATH
2
10
  remote: .
3
11
  specs:
4
- rails-lint (1.0.3)
12
+ rails-lint (1.0.4)
5
13
  erb_lint
6
14
  rubocop-rails
7
15
  rubocop-ruby
@@ -92,10 +100,6 @@ GEM
92
100
  rubocop (~> 1.33)
93
101
  rubocop-capybara (~> 2.17)
94
102
  rubocop-factory_bot (~> 2.22)
95
- rubocop-ruby (1.0.1)
96
- rubocop (~> 1.44.1)
97
- rubocop-performance
98
- rubocop-rspec
99
103
  ruby-progressbar (1.13.0)
100
104
  smart_properties (1.17.0)
101
105
  tzinfo (2.0.6)
@@ -108,6 +112,7 @@ PLATFORMS
108
112
  DEPENDENCIES
109
113
  rails-lint!
110
114
  rake (~> 13.0)
115
+ rubocop-ruby!
111
116
 
112
117
  BUNDLED WITH
113
118
  2.4.8
@@ -0,0 +1,27 @@
1
+ class RailsLint
2
+ def lint
3
+ lint_ruby
4
+ lint_erb
5
+ end
6
+
7
+ def lint_ruby(autocorrect: false)
8
+ require "rubocop"
9
+ cli = RuboCop::CLI.new
10
+ puts "Linting Ruby..."
11
+ spec = Gem::Specification.find_by_name("rails-lint")
12
+ args = ["--config=#{File.expand_path(".rubocop.yml", spec.gem_dir)}", "--display-cop-names", "--force-exclusion"]
13
+ args << "--autocorrect-all" if autocorrect
14
+ cli.run(args)
15
+ end
16
+
17
+ def lint_erb(autocorrect: false)
18
+ require "erb_lint/cli"
19
+
20
+ cli = ERBLint::CLI.new
21
+ spec = Gem::Specification.find_by_name("rails-lint")
22
+ puts "Linting ERB templates..."
23
+ args = ["--lint-all", "--enable-all-linters", "--allow-no-files", "--config=#{File.expand_path(".erb-lint.yml", spec.gem_dir)}"]
24
+ args << "--autocorrect" if autocorrect
25
+ cli.run(args)
26
+ end
27
+ end
@@ -0,0 +1,12 @@
1
+ require_relative "./rails_lint"
2
+
3
+ task "rails-lint" do
4
+ rails_lint = RailsLint.new
5
+ rails_lint.lint
6
+ end
7
+
8
+ task "rails-lint-fix" do
9
+ rails_lint = RailsLint.new
10
+ rails_lint.lint_ruby(autocorrect: true)
11
+ rails_lint.lint_erb(autocorrect: true)
12
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-lint
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - k0va1
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-01 00:00:00.000000000 Z
11
+ date: 2023-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop-ruby
@@ -67,6 +67,8 @@ files:
67
67
  - Makefile
68
68
  - README.md
69
69
  - Rakefile
70
+ - lib/rails-lint/rails_lint.rb
71
+ - lib/rails-lint/rake_tasks.rb
70
72
  homepage: https://github.com/k0va1/rails-lint
71
73
  licenses:
72
74
  - MIT