hyperlaunch-rails-lint 0.1.3 → 0.2.1

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: 64d4abc17a94af4c481affb62b8a4bb215963c963f9fe61755729d33640fbea1
4
- data.tar.gz: 675eb6681e7095ab7571620292d3112c63a87dd1ed04d390befc84fa41eb5496
3
+ metadata.gz: 64141cfbd75492bd55b59aa981c0ce905f2a34704d8a49e76cb407a9705b629b
4
+ data.tar.gz: 6c80420e502fe6f74a5336f01c7fa9f6bf41c1856819cb305fcb0b12a8e60789
5
5
  SHA512:
6
- metadata.gz: 57fce101e85cbfe7d080ec8dc15e93d4ec6b2401891261532d63940991e42fd1c081b03516da4dd3dd32253691c23b7b5b5bbfea7cf181f4ed0fd90b3980aed4
7
- data.tar.gz: da3ace9562ef440e6558f5ca43f236cc51f8c1191f1de17c28ae991e890a452a175a5d0a91d782f15b96b8ad752f97e584ccd1a5733ed4bc39770b656623cc29
6
+ metadata.gz: 57491ca07d82bbe56fe7edaca7fba7c25a252d22f2de57384d22217436a53e4dd129dd9276ff5fa72fe61bb4392a56ac4b7648dbcb0ae6d667978529a698bd14
7
+ data.tar.gz: cff40619d03f56d7a7f6c79a72489055693d43ae6cee78e5cb096b999e9ea68888d3ee5682c3778f84bb539284c2982e4d95d08904cb1922b5b21ff0ed35de0b
@@ -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.1.3
4
+ version: 0.2.1
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/hyperlaunch_rails_lint/rubocop_config/rubocop_config_generator.rb
141
- - lib/generators/hyperlaunch_rails_lint/rubocop_config/templates/rubocop.yml
140
+ - lib/generators/hyperlaunch/rails_lint_setup/rails_lint_setup_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