code_quality_check 0.1.0 → 0.1.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 +4 -4
- data/lib/code_quality_check/version.rb +1 -1
- data/lib/generators/code_quality_check/install_generator.rb +2 -2
- data/lib/generators/code_quality_check/templates/overcommit.yml +60 -0
- data/lib/generators/code_quality_check/templates/rubocop.yml +43 -0
- data/lib/generators/code_quality_check/uninstall_generator.rb +6 -8
- metadata +31 -9
- data/lib/code_quality_check.rb:Zone.Identifier +0 -0
- data/lib/generators/code_quality_check/install_generator.rb:Zone.Identifier +0 -0
- data/lib/generators/code_quality_check/templates/overcommit.rb:Zone.Identifier +0 -0
- data/lib/generators/code_quality_check/uninstall_generator.rb:Zone.Identifier +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13d4abebe3b16f63c43f487c77c60a7e6ecfc235e793b44f54126110665f4e17
|
4
|
+
data.tar.gz: c4f9db62d2a4ffeae2800b3af5e5f76f0f60f01e7c783f3e549fea7533fd7021
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f63bf1be24459df898346a3287688e9746512a901a6080bc52935e0fcbeff4cc4212332dda79aa380240d2eb7fb3e7dba087435a7603896c2ad0c96f438daf1
|
7
|
+
data.tar.gz: a65a9bca1cdf9aae4341b487a05ff55ef4b73b87e32f7f0b780ff270c9b61e09c8b8723b12ceee751bdd7fb14ca7f01bb3ed4bb7a99c54adf646b5618465e576
|
@@ -15,10 +15,10 @@ module CodeQualityCheck
|
|
15
15
|
template 'overcommit.rb', 'config/initializers/overcommit.rb'
|
16
16
|
|
17
17
|
# Copy the Overcommit configuration file to the root directory
|
18
|
-
template '
|
18
|
+
template 'overcommit.yml', '.overcommit.yml'
|
19
19
|
|
20
20
|
# Copy the RuboCop configuration file to the root directory
|
21
|
-
template '
|
21
|
+
template 'rubocop.yml', '.rubocop.yml'
|
22
22
|
end
|
23
23
|
end
|
24
24
|
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# Use this file to configure the Overcommit hooks you wish to use. This will
|
2
|
+
# extend the default configuration defined in:
|
3
|
+
# https://github.com/sds/overcommit/blob/master/config/default.yml
|
4
|
+
#
|
5
|
+
# At the topmost level of this YAML file is a key representing type of hook
|
6
|
+
# being run (e.g. pre-commit, commit-msg, etc.). Within each type you can
|
7
|
+
# customize each hook, such as whether to only run it on certain files (via
|
8
|
+
# `include`), whether to only display output if it fails (via `quiet`), etc.
|
9
|
+
#
|
10
|
+
# For a complete list of hooks, see:
|
11
|
+
# https://github.com/sds/overcommit/tree/master/lib/overcommit/hook
|
12
|
+
#
|
13
|
+
# For a complete list of options that you can use to customize hooks, see:
|
14
|
+
# https://github.com/sds/overcommit#configuration
|
15
|
+
#
|
16
|
+
# Uncomment the following lines to make the configuration take effect.
|
17
|
+
|
18
|
+
PreCommit:
|
19
|
+
RuboCop:
|
20
|
+
enabled: true
|
21
|
+
description: 'Analyzing Ruby code style with RuboCop'
|
22
|
+
required_executable: 'rubocop'
|
23
|
+
command: ['bundle', 'exec', 'rubocop']
|
24
|
+
flags: ['--force-exclusion']
|
25
|
+
problem_on_unmodified_line: ignore
|
26
|
+
|
27
|
+
# RailsBestPractices is a code metric tool to check the quality of Rails code.
|
28
|
+
RailsBestPractices:
|
29
|
+
enabled: true
|
30
|
+
on_warn: fail
|
31
|
+
exclude:
|
32
|
+
- '**/lib/**/*'
|
33
|
+
|
34
|
+
# Brakeman is a static analysis security vulnerability scanner for Ruby on Rails applications.
|
35
|
+
Brakeman:
|
36
|
+
enabled: true
|
37
|
+
command: ['brakeman', '--skip-libs', '-w3']
|
38
|
+
|
39
|
+
TrailingWhitespace:
|
40
|
+
enabled: true
|
41
|
+
exclude:
|
42
|
+
- '**/lib/**/*' # Ignore trailing whitespace in generated files
|
43
|
+
|
44
|
+
AuthorName:
|
45
|
+
enabled: true
|
46
|
+
AuthorEmail:
|
47
|
+
enabled: true
|
48
|
+
BrokenSymlinks:
|
49
|
+
enabled: true
|
50
|
+
CaseConflicts:
|
51
|
+
enabled: true
|
52
|
+
MergeConflicts:
|
53
|
+
enabled: true
|
54
|
+
|
55
|
+
#PostCheckout:
|
56
|
+
# ALL: # Special hook name that customizes all hooks of this type
|
57
|
+
# quiet: true # Change all post-checkout hooks to only display output on failure
|
58
|
+
#
|
59
|
+
# IndexTags:
|
60
|
+
# enabled: true # Generate a tags file with `ctags` each time HEAD changes
|
@@ -0,0 +1,43 @@
|
|
1
|
+
Style/Encoding:
|
2
|
+
Enabled: false
|
3
|
+
Style/AsciiComments:
|
4
|
+
Enabled: false
|
5
|
+
Layout/LineLength:
|
6
|
+
Max: 300
|
7
|
+
Metrics/ClassLength:
|
8
|
+
Max: 400
|
9
|
+
Metrics/AbcSize:
|
10
|
+
Max: 150
|
11
|
+
Metrics/MethodLength:
|
12
|
+
Max: 40
|
13
|
+
Metrics/PerceivedComplexity:
|
14
|
+
Max: 30
|
15
|
+
Metrics/BlockLength:
|
16
|
+
CountComments: false # count full line comments?
|
17
|
+
Max: 50
|
18
|
+
Metrics/CyclomaticComplexity:
|
19
|
+
Max: 30
|
20
|
+
Style/FrozenStringLiteralComment:
|
21
|
+
Enabled: false
|
22
|
+
Style/HashSyntax:
|
23
|
+
Enabled: false
|
24
|
+
Style/OptionalBooleanParameter:
|
25
|
+
Enabled: false
|
26
|
+
Style/ClassAndModuleChildren:
|
27
|
+
EnforcedStyle: compact
|
28
|
+
SupportedStyles:
|
29
|
+
- nested
|
30
|
+
- compact
|
31
|
+
Layout/EndOfLine:
|
32
|
+
Enabled: False
|
33
|
+
AllCops:
|
34
|
+
NewCops: disable
|
35
|
+
SuggestExtensions: false
|
36
|
+
Exclude:
|
37
|
+
- 'db/schema.rb'
|
38
|
+
- 'db/migrate/**/*'
|
39
|
+
- 'bin/*'
|
40
|
+
- 'config/**/*'
|
41
|
+
- 'config.ru'
|
42
|
+
- 'Rakefile'
|
43
|
+
- 'test/**'
|
@@ -1,29 +1,27 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'rails/generators/base'
|
3
4
|
|
4
5
|
module CodeQualityCheck
|
5
6
|
module Generators
|
7
|
+
# Uninstall generator to remove Overcommit and RuboCop configuration files
|
6
8
|
class UninstallGenerator < Rails::Generators::Base
|
7
9
|
desc 'This generator removes Overcommit and RuboCop configuration files'
|
8
10
|
|
11
|
+
# Remove Overcommit and RuboCop configuration files
|
9
12
|
def remove_files
|
10
13
|
# List of files to be removed
|
11
|
-
files_to_remove = [
|
12
|
-
'config/initializers/overcommit.rb',
|
13
|
-
'.overcommit.yml',
|
14
|
-
'.rubocop.yml'
|
15
|
-
]
|
14
|
+
files_to_remove = ['config/initializers/overcommit.rb', '.overcommit.yml', '.rubocop.yml']
|
16
15
|
|
17
16
|
files_to_remove.each do |file|
|
18
17
|
if File.exist?(file)
|
19
18
|
remove_file file
|
20
19
|
say_status('removed', file)
|
21
|
-
else
|
22
|
-
say_status('not found', file, :yellow)
|
23
20
|
end
|
24
21
|
end
|
25
22
|
end
|
26
23
|
|
24
|
+
# Uninstall Overcommit
|
27
25
|
def uninstall_overcommit
|
28
26
|
# uninstall overcommit
|
29
27
|
run 'bundle exec overcommit --uninstall'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: code_quality_check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aniruddha Mirajkar
|
@@ -52,6 +52,26 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.21'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop-performance
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.23'
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: 1.23.1
|
65
|
+
type: :runtime
|
66
|
+
prerelease: false
|
67
|
+
version_requirements: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - "~>"
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '1.23'
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 1.23.1
|
55
75
|
description: Integrates Overcommit with RuboCop, Rails Best Practices, and Brakeman
|
56
76
|
for automated code quality checks.
|
57
77
|
email:
|
@@ -61,19 +81,21 @@ extensions: []
|
|
61
81
|
extra_rdoc_files: []
|
62
82
|
files:
|
63
83
|
- lib/code_quality_check.rb
|
64
|
-
- lib/code_quality_check.rb:Zone.Identifier
|
65
84
|
- lib/code_quality_check/version.rb
|
66
85
|
- lib/code_quality_check/version.rb:Zone.Identifier
|
67
86
|
- lib/generators/code_quality_check/install_generator.rb
|
68
|
-
- lib/generators/code_quality_check/install_generator.rb:Zone.Identifier
|
69
87
|
- lib/generators/code_quality_check/templates/overcommit.rb
|
70
|
-
- lib/generators/code_quality_check/templates/overcommit.
|
88
|
+
- lib/generators/code_quality_check/templates/overcommit.yml
|
89
|
+
- lib/generators/code_quality_check/templates/rubocop.yml
|
71
90
|
- lib/generators/code_quality_check/uninstall_generator.rb
|
72
|
-
|
73
|
-
homepage: https://github.com/yourusername/code_quality_check
|
91
|
+
homepage: https://github.com/aniruddhami/code_quality_check
|
74
92
|
licenses:
|
75
93
|
- MIT
|
76
|
-
metadata:
|
94
|
+
metadata:
|
95
|
+
homepage_uri: https://github.com/aniruddhami/code_quality_check
|
96
|
+
source_code_uri: https://github.com/aniruddhami/code_quality_check
|
97
|
+
changelog_uri: https://github.com/aniruddhami/code_quality_check/CHANGELOG.md
|
98
|
+
rubygems_mfa_required: 'true'
|
77
99
|
post_install_message:
|
78
100
|
rdoc_options: []
|
79
101
|
require_paths:
|
@@ -82,14 +104,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
82
104
|
requirements:
|
83
105
|
- - ">="
|
84
106
|
- !ruby/object:Gem::Version
|
85
|
-
version:
|
107
|
+
version: 3.1.0
|
86
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
109
|
requirements:
|
88
110
|
- - ">="
|
89
111
|
- !ruby/object:Gem::Version
|
90
112
|
version: '0'
|
91
113
|
requirements: []
|
92
|
-
rubygems_version: 3.4.
|
114
|
+
rubygems_version: 3.4.19
|
93
115
|
signing_key:
|
94
116
|
specification_version: 4
|
95
117
|
summary: A gem to enforce code quality checks using Git hooks
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|