tal_style 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 45e8a1b325028d841153a9fc6544719266a044fc073bbfeea6e24a319e2352ae
4
+ data.tar.gz: 2f216c846114115fc48957898e530a26beea6989c9de3e809a7cb3a33aee283a
5
+ SHA512:
6
+ metadata.gz: 8dbfe06153dda26296b650e65b56a04378887d32b295c38b28266bdd89e7470a915d534975839fb00aa7c8d45ea6c53ffa7048a8f30757a471a96ca1004caeaf
7
+ data.tar.gz: 0d6218a09caaefeb85ad9403a90291852fc5749be349b916304362a7ea670de788f610f0f14413c7dc26b6a0dbd1587b909ae8553e1cde33c9bc7626d40eaf55
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ .idea
2
+ *.gem
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
6
+
7
+ # gem "rails"
data/Gemfile.lock ADDED
@@ -0,0 +1,11 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+
5
+ PLATFORMS
6
+ ruby
7
+
8
+ DEPENDENCIES
9
+
10
+ BUNDLED WITH
11
+ 1.16.3
@@ -0,0 +1,19 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/base'
3
+
4
+ module TalStyle
5
+ class InstallGenerator < Rails::Generators::Base
6
+ def self.source_root
7
+ @source_root ||= File.expand_path(File.join(File.dirname(__FILE__), 'templates'))
8
+ end
9
+
10
+ def create_root_reek_yml
11
+ template "reek", ".reek", orce: true
12
+ end
13
+
14
+ def create_root_rubocop
15
+ template "rubocop.yml", ".rubocop.yml", force: true
16
+ end
17
+ end
18
+ end
19
+
@@ -0,0 +1,133 @@
1
+ ---
2
+ Attribute:
3
+ enabled: true
4
+ exclude: []
5
+ BooleanParameter:
6
+ enabled: true
7
+ exclude: []
8
+ ClassVariable:
9
+ enabled: true
10
+ exclude: []
11
+ ControlParameter:
12
+ enabled: true
13
+ exclude: []
14
+ DataClump:
15
+ enabled: true
16
+ exclude: []
17
+ max_copies: 2
18
+ min_clump_size: 2
19
+ DuplicateMethodCall:
20
+ enabled: true
21
+ exclude: []
22
+ max_calls: 1
23
+ allow_calls: []
24
+ FeatureEnvy:
25
+ enabled: true
26
+ exclude: []
27
+ Attribute:
28
+ exclude: []
29
+ InstanceVariableAssumption:
30
+ enabled: false
31
+ exclude: []
32
+ IrresponsibleModule:
33
+ enabled: false
34
+ exclude: []
35
+ LongParameterList:
36
+ enabled: true
37
+ exclude: []
38
+ max_params: 3
39
+ overrides:
40
+ initialize:
41
+ max_params: 5
42
+ LongYieldList:
43
+ enabled: true
44
+ exclude: []
45
+ max_params: 3
46
+ ManualDispatch:
47
+ enabled: true
48
+ exclude: []
49
+ ModuleInitialize:
50
+ enabled: true
51
+ exclude: []
52
+ NestedIterators:
53
+ enabled: true
54
+ exclude: []
55
+ max_allowed_nesting: 1
56
+ ignore_iterators:
57
+ - tap
58
+ NilCheck:
59
+ enabled: true
60
+ exclude: []
61
+ PrimaDonnaMethod:
62
+ enabled: true
63
+ exclude: []
64
+ RepeatedConditional:
65
+ enabled: true
66
+ exclude: []
67
+ max_ifs: 2
68
+ SubclassedFromCoreClass:
69
+ enabled: true
70
+ exclude: []
71
+ Syntax:
72
+ enabled: true
73
+ exclude: []
74
+ TooManyConstants:
75
+ enabled: true
76
+ exclude: []
77
+ max_constants: 5
78
+ TooManyInstanceVariables:
79
+ enabled: true
80
+ exclude: []
81
+ max_instance_variables: 4
82
+ TooManyMethods:
83
+ enabled: true
84
+ exclude: []
85
+ max_methods: 15
86
+ TooManyStatements:
87
+ enabled: true
88
+ exclude: []
89
+ max_statements: 5
90
+ UncommunicativeMethodName:
91
+ enabled: true
92
+ exclude: []
93
+ reject:
94
+ - !ruby/regexp /^[a-z]$/
95
+ - !ruby/regexp /[0-9]$/
96
+ - !ruby/regexp /[A-Z]/
97
+ accept: []
98
+ UncommunicativeModuleName:
99
+ enabled: true
100
+ exclude: []
101
+ reject:
102
+ - !ruby/regexp /^.$/
103
+ - !ruby/regexp /[0-9]$/
104
+ accept: []
105
+ UncommunicativeParameterName:
106
+ enabled: true
107
+ exclude: []
108
+ reject:
109
+ - !ruby/regexp /^.$/
110
+ - !ruby/regexp /[0-9]$/
111
+ - !ruby/regexp /[A-Z]/
112
+ - !ruby/regexp /^_/
113
+ accept: []
114
+ UncommunicativeVariableName:
115
+ enabled: true
116
+ exclude: []
117
+ reject:
118
+ - !ruby/regexp /^.$/
119
+ - !ruby/regexp /[0-9]$/
120
+ - !ruby/regexp /[A-Z]/
121
+ accept:
122
+ - !ruby/regexp /^_$/
123
+ UnusedParameters:
124
+ enabled: true
125
+ exclude: []
126
+ UnusedPrivateMethod:
127
+ enabled: false
128
+ exclude: []
129
+ UtilityFunction:
130
+ enabled: true
131
+ exclude: []
132
+ public_methods_only: false
133
+
@@ -0,0 +1,2 @@
1
+ inherit_gem:
2
+ tal_style: rails/rubocop.yml
data/rails/rubocop.yml ADDED
@@ -0,0 +1,28 @@
1
+ Documentation:
2
+ Enabled: false
3
+ Style/FrozenStringLiteralComment:
4
+ Enabled: false
5
+ Style/ParallelAssignment:
6
+ Enabled: false
7
+ Style/NumericPredicate:
8
+ Enabled: false
9
+ Metrics/LineLength:
10
+ Description: 'Limit lines to 120 characters.'
11
+ Max: 120
12
+ Metrics/BlockLength:
13
+ CountComments: false
14
+ Max: 25
15
+ Metrics/MethodLength:
16
+ Description: 'Avoid methods longer than `Max` lines of code.'
17
+ CountComments: false
18
+ Max: 15
19
+ Enabled: true
20
+ Metrics/ClassLength:
21
+ Enabled: false
22
+ AllCops:
23
+ Exclude:
24
+ - bin/**/*
25
+ - vendor/**/*
26
+ - db/schema.rb
27
+ Rails:
28
+ Enabled: true
data/readme.md ADDED
@@ -0,0 +1,28 @@
1
+ Rails TAL Style
2
+ ==================
3
+
4
+ A gem to unify the development styles across the rails projects [The Appraisal Lane](theappraisallane.com).
5
+ This project is inspired by [house_style](https://github.com/altmetric/house_style)
6
+
7
+ # Dependencies
8
+
9
+ This project includes dependencies and configuration files for [reek](https://github.com/troessner/reek), [rubocop](https://github.com/rubocop-hq/rubocop) and [rails best practices](https://github.com/flyerhzm/rails_best_practices).
10
+
11
+ ## Installation and configuration
12
+
13
+ Add the following line to your project's `Gemfile`
14
+
15
+ ```(ruby)
16
+ group :test, :development do
17
+ gem 'tal_style'
18
+ end
19
+ ```
20
+
21
+ After that, run the generator in order to copy the config files to the application's root directory. **This will override your current `.reek` and `.rubocop.yml` files**
22
+ ```
23
+ rails generate tal_style:install
24
+ ```
25
+
26
+ That's all!
27
+ Every time you run reek and rubocop in your project the shared config will be loaded.
28
+
data/tal_style.gemspec ADDED
@@ -0,0 +1,25 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+
4
+ Gem::Specification.new do |spec|
5
+ spec.name = %q{tal_style}
6
+ spec.version = '1.0.0'
7
+ spec.authors = ['The Appraisal Lane', 'Esteban Bordon']
8
+ spec.email = ['developers@theappraisallane.com', 'ebordon@gmail.com']
9
+
10
+ spec.summary = %q{Style guides to develop TAL applications in rails}
11
+ spec.description = 'Configuration files and other snippets to help you apply standards across multiple projects'
12
+ spec.homepage = 'https://github.com/theappraisallane/rails-tal-style'
13
+ spec.license = 'MIT'
14
+
15
+ spec.post_install_message = <<-ENDOFMESSAGE
16
+ TAL styles were installed!
17
+ ENDOFMESSAGE
18
+
19
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
20
+ spec.require_paths = ['lib']
21
+
22
+ spec.add_dependency 'rubocop', '~> 0.51', '< 0.65'
23
+ spec.add_dependency 'rails_best_practices', '<= 1.19.4'
24
+ spec.add_dependency 'reek', '<= 5.3.1'
25
+ end
metadata ADDED
@@ -0,0 +1,106 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tal_style
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - The Appraisal Lane
8
+ - Esteban Bordon
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2019-03-14 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rubocop
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '0.51'
21
+ - - "<"
22
+ - !ruby/object:Gem::Version
23
+ version: '0.65'
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - "~>"
29
+ - !ruby/object:Gem::Version
30
+ version: '0.51'
31
+ - - "<"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.65'
34
+ - !ruby/object:Gem::Dependency
35
+ name: rails_best_practices
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "<="
39
+ - !ruby/object:Gem::Version
40
+ version: 1.19.4
41
+ type: :runtime
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "<="
46
+ - !ruby/object:Gem::Version
47
+ version: 1.19.4
48
+ - !ruby/object:Gem::Dependency
49
+ name: reek
50
+ requirement: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "<="
53
+ - !ruby/object:Gem::Version
54
+ version: 5.3.1
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "<="
60
+ - !ruby/object:Gem::Version
61
+ version: 5.3.1
62
+ description: Configuration files and other snippets to help you apply standards across
63
+ multiple projects
64
+ email:
65
+ - developers@theappraisallane.com
66
+ - ebordon@gmail.com
67
+ executables: []
68
+ extensions: []
69
+ extra_rdoc_files: []
70
+ files:
71
+ - ".gitignore"
72
+ - Gemfile
73
+ - Gemfile.lock
74
+ - lib/generators/tal_style/install_generator.rb
75
+ - lib/generators/tal_style/templates/reek
76
+ - lib/generators/tal_style/templates/rubocop.yml
77
+ - rails/rubocop.yml
78
+ - readme.md
79
+ - tal_style.gemspec
80
+ homepage: https://github.com/theappraisallane/rails-tal-style
81
+ licenses:
82
+ - MIT
83
+ metadata: {}
84
+ post_install_message: 'TAL styles were installed!
85
+
86
+ '
87
+ rdoc_options: []
88
+ require_paths:
89
+ - lib
90
+ required_ruby_version: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ required_rubygems_version: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
100
+ requirements: []
101
+ rubyforge_project:
102
+ rubygems_version: 2.7.6
103
+ signing_key:
104
+ specification_version: 4
105
+ summary: Style guides to develop TAL applications in rails
106
+ test_files: []