hyperlaunch-rails-lint 0.1.3 → 0.2.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/lib/generators/hyperlaunch/rails_lint_setup/rubocop_config_generator.rb +21 -0
- data/lib/generators/hyperlaunch/rails_lint_setup/templates/pre-push.erb +13 -0
- metadata +4 -3
- data/lib/generators/hyperlaunch_rails_lint/rubocop_config/rubocop_config_generator.rb +0 -14
- /data/lib/generators/{hyperlaunch_rails_lint/rubocop_config → hyperlaunch/rails_lint_setup}/templates/rubocop.yml +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4dd321591b71d5372ffbe12305e83ef08e1b0c0e656f3941144c6b4bdb71d39
|
4
|
+
data.tar.gz: 0f14877dc545bbc4139f5eaf9e0aad782ea54f83440f50300c5a833365343f9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84a0578f8e88b0902bfd1a03321593c995ca51c9e12ff485b8835778658d2964d5f81972e516fa8f57d923939f63ab48321b81f473f09d205f3caa5ab2530d52
|
7
|
+
data.tar.gz: 2b5de0f59dedaab41eb047721a051e1ef350350a2f268777fcb832915d973cc8a8ae92f6a46462988b034bc60720d7955806df359e0c0ab4eea41fbd511236bd
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
module Hyperlaunch
|
5
|
+
module Generators
|
6
|
+
# Generates a rubocop config and pre push hook
|
7
|
+
class RailsLintSetupGenerator < Rails::Generators::Base
|
8
|
+
source_root File.expand_path('templates', __dir__)
|
9
|
+
desc 'Installs .rubocop.yml and a pre‑push git hook that runs `rubocop -A`.'
|
10
|
+
|
11
|
+
def copy_rubocop_config
|
12
|
+
copy_file 'rubocop.yml', '.rubocop.yml', force: true
|
13
|
+
end
|
14
|
+
|
15
|
+
def install_git_hook
|
16
|
+
template 'pre-push.erb', '.git/hooks/pre-push', force: true
|
17
|
+
FileUtils.chmod('+x', '.git/hooks/pre-push')
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
# Installed by hyperlaunch‑rails‑lint
|
3
|
+
|
4
|
+
echo "Running RuboCop autocorrect…"
|
5
|
+
bundle exec rubocop -A
|
6
|
+
status=$?
|
7
|
+
|
8
|
+
if [ "$status" -ne 0 ]; then
|
9
|
+
echo "❌ RuboCop offences remain. Push aborted."
|
10
|
+
exit $status
|
11
|
+
fi
|
12
|
+
|
13
|
+
echo "✅ Clean – push continuing."
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyperlaunch-rails-lint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Garrett
|
@@ -137,8 +137,9 @@ executables: []
|
|
137
137
|
extensions: []
|
138
138
|
extra_rdoc_files: []
|
139
139
|
files:
|
140
|
-
- lib/generators/
|
141
|
-
- lib/generators/
|
140
|
+
- lib/generators/hyperlaunch/rails_lint_setup/rubocop_config_generator.rb
|
141
|
+
- lib/generators/hyperlaunch/rails_lint_setup/templates/pre-push.erb
|
142
|
+
- lib/generators/hyperlaunch/rails_lint_setup/templates/rubocop.yml
|
142
143
|
- lib/hyperlaunch_rails_lint.rb
|
143
144
|
- rubocop.yml
|
144
145
|
homepage: https://github.com/hyperlaunch/hyperlaunch-rails-lint
|
@@ -1,14 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module HyperlaunchRailsLint
|
4
|
-
module Generators
|
5
|
-
# Generate .rubocop.yml file into project
|
6
|
-
class RubocopConfigGenerator < Rails::Generators::Base
|
7
|
-
source_root File.expand_path('templates', __dir__)
|
8
|
-
|
9
|
-
def copy_rubocop_file
|
10
|
-
template 'rubocop.yml', '.rubocop.yml', force: false
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
File without changes
|