boost-styles 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 875408b1910b5f54ef8611b71325ab1f1a66e2b5b4fbb7a8219ad0c7e3961b99
4
+ data.tar.gz: f987fd5e2bcb7531379daac2dc2aef4e8bc704190c92a54bd5511299b2b582bc
5
+ SHA512:
6
+ metadata.gz: b523c0c0f5a44b9f1ba8e3fa0e83f68af458f5b5f88b0facd45de289d2fc22157587843e09970c243c45e2da4dd182786e3d690e23b520427f4d224dd1595bd6
7
+ data.tar.gz: 1a6c1694115e11c66f19cbf79e3609722376a9d8a0db2b37e0b8dd1d03abf0d4adfa064f3cacc1e736369988e8bcf5f6eacc6c709df0423e97a17b127a430d2b
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
@@ -0,0 +1,10 @@
1
+ linters:
2
+ ImplicitDiv:
3
+ enabled: false
4
+ severity: error
5
+
6
+ LineLength:
7
+ max: 100
8
+
9
+ RuboCop:
10
+ enabled: false
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,3 @@
1
+ inherit_from:
2
+ - rubocop_default.yml
3
+ - .rubocop_todo.yml
@@ -0,0 +1,7 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2020-01-24 13:57:43 +1300 using RuboCop version 0.79.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
@@ -0,0 +1 @@
1
+ 2.6.5
@@ -0,0 +1,8 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.5.1
7
+ - 2.6.5
8
+ before_install: gem install bundler -v 2.1.4
File without changes
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at info@boost.co.nz. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ # Specify your gem's dependencies in boost-styles.gemspec
6
+ gemspec
@@ -0,0 +1,202 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ boost-styles (0.1.2)
5
+ haml_lint (~> 0.33)
6
+ rubocop (~> 0.8)
7
+ rubocop-performance (~> 1)
8
+ rubocop-rails (~> 2)
9
+ rubocop-rspec (~> 1)
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ actioncable (6.0.3.1)
15
+ actionpack (= 6.0.3.1)
16
+ nio4r (~> 2.0)
17
+ websocket-driver (>= 0.6.1)
18
+ actionmailbox (6.0.3.1)
19
+ actionpack (= 6.0.3.1)
20
+ activejob (= 6.0.3.1)
21
+ activerecord (= 6.0.3.1)
22
+ activestorage (= 6.0.3.1)
23
+ activesupport (= 6.0.3.1)
24
+ mail (>= 2.7.1)
25
+ actionmailer (6.0.3.1)
26
+ actionpack (= 6.0.3.1)
27
+ actionview (= 6.0.3.1)
28
+ activejob (= 6.0.3.1)
29
+ mail (~> 2.5, >= 2.5.4)
30
+ rails-dom-testing (~> 2.0)
31
+ actionpack (6.0.3.1)
32
+ actionview (= 6.0.3.1)
33
+ activesupport (= 6.0.3.1)
34
+ rack (~> 2.0, >= 2.0.8)
35
+ rack-test (>= 0.6.3)
36
+ rails-dom-testing (~> 2.0)
37
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
38
+ actiontext (6.0.3.1)
39
+ actionpack (= 6.0.3.1)
40
+ activerecord (= 6.0.3.1)
41
+ activestorage (= 6.0.3.1)
42
+ activesupport (= 6.0.3.1)
43
+ nokogiri (>= 1.8.5)
44
+ actionview (6.0.3.1)
45
+ activesupport (= 6.0.3.1)
46
+ builder (~> 3.1)
47
+ erubi (~> 1.4)
48
+ rails-dom-testing (~> 2.0)
49
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
50
+ activejob (6.0.3.1)
51
+ activesupport (= 6.0.3.1)
52
+ globalid (>= 0.3.6)
53
+ activemodel (6.0.3.1)
54
+ activesupport (= 6.0.3.1)
55
+ activerecord (6.0.3.1)
56
+ activemodel (= 6.0.3.1)
57
+ activesupport (= 6.0.3.1)
58
+ activestorage (6.0.3.1)
59
+ actionpack (= 6.0.3.1)
60
+ activejob (= 6.0.3.1)
61
+ activerecord (= 6.0.3.1)
62
+ marcel (~> 0.3.1)
63
+ activesupport (6.0.3.1)
64
+ concurrent-ruby (~> 1.0, >= 1.0.2)
65
+ i18n (>= 0.7, < 2)
66
+ minitest (~> 5.1)
67
+ tzinfo (~> 1.1)
68
+ zeitwerk (~> 2.2, >= 2.2.2)
69
+ ast (2.4.1)
70
+ builder (3.2.4)
71
+ concurrent-ruby (1.1.6)
72
+ crass (1.0.6)
73
+ diff-lcs (1.3)
74
+ erubi (1.9.0)
75
+ globalid (0.4.2)
76
+ activesupport (>= 4.2.0)
77
+ haml (5.1.2)
78
+ temple (>= 0.8.0)
79
+ tilt
80
+ haml_lint (0.35.0)
81
+ haml (>= 4.0, < 5.2)
82
+ rainbow
83
+ rubocop (>= 0.50.0)
84
+ sysexits (~> 1.1)
85
+ i18n (1.8.3)
86
+ concurrent-ruby (~> 1.0)
87
+ loofah (2.5.0)
88
+ crass (~> 1.0.2)
89
+ nokogiri (>= 1.5.9)
90
+ mail (2.7.1)
91
+ mini_mime (>= 0.1.1)
92
+ marcel (0.3.3)
93
+ mimemagic (~> 0.3.2)
94
+ method_source (1.0.0)
95
+ mimemagic (0.3.5)
96
+ mini_mime (1.0.2)
97
+ mini_portile2 (2.4.0)
98
+ minitest (5.14.1)
99
+ nio4r (2.5.2)
100
+ nokogiri (1.10.9)
101
+ mini_portile2 (~> 2.4.0)
102
+ parallel (1.19.1)
103
+ parser (2.7.1.3)
104
+ ast (~> 2.4.0)
105
+ rack (2.2.2)
106
+ rack-test (1.1.0)
107
+ rack (>= 1.0, < 3)
108
+ rails (6.0.3.1)
109
+ actioncable (= 6.0.3.1)
110
+ actionmailbox (= 6.0.3.1)
111
+ actionmailer (= 6.0.3.1)
112
+ actionpack (= 6.0.3.1)
113
+ actiontext (= 6.0.3.1)
114
+ actionview (= 6.0.3.1)
115
+ activejob (= 6.0.3.1)
116
+ activemodel (= 6.0.3.1)
117
+ activerecord (= 6.0.3.1)
118
+ activestorage (= 6.0.3.1)
119
+ activesupport (= 6.0.3.1)
120
+ bundler (>= 1.3.0)
121
+ railties (= 6.0.3.1)
122
+ sprockets-rails (>= 2.0.0)
123
+ rails-dom-testing (2.0.3)
124
+ activesupport (>= 4.2.0)
125
+ nokogiri (>= 1.6)
126
+ rails-html-sanitizer (1.3.0)
127
+ loofah (~> 2.3)
128
+ railties (6.0.3.1)
129
+ actionpack (= 6.0.3.1)
130
+ activesupport (= 6.0.3.1)
131
+ method_source
132
+ rake (>= 0.8.7)
133
+ thor (>= 0.20.3, < 2.0)
134
+ rainbow (3.0.0)
135
+ rake (13.0.1)
136
+ regexp_parser (1.7.1)
137
+ rexml (3.2.4)
138
+ rspec (3.9.0)
139
+ rspec-core (~> 3.9.0)
140
+ rspec-expectations (~> 3.9.0)
141
+ rspec-mocks (~> 3.9.0)
142
+ rspec-core (3.9.2)
143
+ rspec-support (~> 3.9.3)
144
+ rspec-expectations (3.9.2)
145
+ diff-lcs (>= 1.2.0, < 2.0)
146
+ rspec-support (~> 3.9.0)
147
+ rspec-mocks (3.9.1)
148
+ diff-lcs (>= 1.2.0, < 2.0)
149
+ rspec-support (~> 3.9.0)
150
+ rspec-support (3.9.3)
151
+ rubocop (0.85.1)
152
+ parallel (~> 1.10)
153
+ parser (>= 2.7.0.1)
154
+ rainbow (>= 2.2.2, < 4.0)
155
+ regexp_parser (>= 1.7)
156
+ rexml
157
+ rubocop-ast (>= 0.0.3)
158
+ ruby-progressbar (~> 1.7)
159
+ unicode-display_width (>= 1.4.0, < 2.0)
160
+ rubocop-ast (0.0.3)
161
+ parser (>= 2.7.0.1)
162
+ rubocop-performance (1.6.1)
163
+ rubocop (>= 0.71.0)
164
+ rubocop-rails (2.6.0)
165
+ activesupport (>= 4.2.0)
166
+ rack (>= 1.1)
167
+ rubocop (>= 0.82.0)
168
+ rubocop-rspec (1.40.0)
169
+ rubocop (>= 0.68.1)
170
+ ruby-progressbar (1.10.1)
171
+ sprockets (4.0.2)
172
+ concurrent-ruby (~> 1.0)
173
+ rack (> 1, < 3)
174
+ sprockets-rails (3.2.1)
175
+ actionpack (>= 4.0)
176
+ activesupport (>= 4.0)
177
+ sprockets (>= 3.0.0)
178
+ sysexits (1.2.0)
179
+ temple (0.8.2)
180
+ thor (1.0.1)
181
+ thread_safe (0.3.6)
182
+ tilt (2.0.10)
183
+ tzinfo (1.2.7)
184
+ thread_safe (~> 0.1)
185
+ unicode-display_width (1.7.0)
186
+ websocket-driver (0.7.2)
187
+ websocket-extensions (>= 0.1.0)
188
+ websocket-extensions (0.1.5)
189
+ zeitwerk (2.3.0)
190
+
191
+ PLATFORMS
192
+ ruby
193
+
194
+ DEPENDENCIES
195
+ boost-styles!
196
+ bundler (~> 2.0)
197
+ rails (~> 6.0.1)
198
+ rake (~> 13.0)
199
+ rspec (~> 3.0)
200
+
201
+ BUNDLED WITH
202
+ 2.1.4
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Boost
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,44 @@
1
+ # Boost::Styles [![Build Status](https://travis-ci.org/boost/boost-styles.svg?branch=master)](https://travis-ci.org/boost/boost-styles)
2
+
3
+ Shared Boost styles configuration
4
+
5
+ ## What's inside?
6
+ - ✅ Rubocop for Rails
7
+ - ✅ Rubocop performance
8
+ - ✅ Rubocop RSpec
9
+ - ✅ Stylelint
10
+ - ✅ HAML Lint
11
+ - ✅ ESLint Lint
12
+
13
+ ## Installation
14
+
15
+ Add this line to your application's Gemfile:
16
+
17
+ ```ruby
18
+ group :development do
19
+ ...
20
+ gem 'boost-styles', git: 'https://github.com/boost/boost-styles.git'
21
+ ...
22
+ end
23
+ ```
24
+
25
+ Run bundle:
26
+
27
+ $ bundle
28
+
29
+ Run the generator:
30
+
31
+ $ rails g boost_styles:install
32
+
33
+
34
+ ## Contributing
35
+
36
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/boost-styles. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
37
+
38
+ ## License
39
+
40
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
41
+
42
+ ## Code of Conduct
43
+
44
+ Everyone interacting in the Boost::Styles project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/boost-styles/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rspec/core/rake_task'
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require 'bundler/setup'
5
+ require 'boost/styles'
6
+
7
+ # You can add fixtures and/or initialization code here to make experimenting
8
+ # with your gem easier. You can also use a different console, if you like.
9
+
10
+ # (If you use this, don't forget to add pry to your Gemfile!)
11
+ # require "pry"
12
+ # Pry.start
13
+
14
+ require 'irb'
15
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ lib = File.expand_path('lib', __dir__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
+ require 'boost/styles/version'
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'boost-styles'
9
+ spec.version = Boost::Styles::VERSION
10
+ spec.authors = ['Boost']
11
+ spec.email = ['info@boost.co.nz']
12
+
13
+ spec.summary = 'Shared Boost styles configuration'
14
+ spec.description = 'Centralised gem for all Boost styles configuration (Rubocop, ESLint etc...)'
15
+ spec.homepage = 'https://github.com/boost/boost-styles'
16
+ spec.license = 'MIT'
17
+
18
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
19
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
20
+ if spec.respond_to?(:metadata)
21
+ spec.metadata['allowed_push_host'] = 'https://rubygems.org'
22
+
23
+ spec.metadata['homepage_uri'] = spec.homepage
24
+ spec.metadata['source_code_uri'] = 'https://github.com/boost/boost-styles'
25
+ spec.metadata['changelog_uri'] = 'https://github.com/boost/boost-styles/CHANGELOG.md'
26
+ else
27
+ raise 'RubyGems 2.0 or newer is required to protect against ' \
28
+ 'public gem pushes.'
29
+ end
30
+
31
+ # Specify which files should be added to the gem when it is released.
32
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
33
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
34
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
35
+ end
36
+ spec.bindir = 'exe'
37
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
38
+ spec.require_paths = ['lib']
39
+
40
+ spec.add_development_dependency 'bundler', '~> 2.0'
41
+ spec.add_development_dependency 'rails', '~> 6.0.1'
42
+ spec.add_development_dependency 'rake', '~> 13.0'
43
+ spec.add_development_dependency 'rspec', '~> 3.0'
44
+
45
+ spec.add_dependency 'haml_lint', '~> 0.33'
46
+ spec.add_dependency 'rubocop', '~> 0.8'
47
+ spec.add_dependency 'rubocop-performance', '~> 1'
48
+ spec.add_dependency 'rubocop-rails', '~> 2'
49
+ spec.add_dependency 'rubocop-rspec', '~> 1'
50
+ end
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'boost/styles/version'
4
+
5
+ module Boost
6
+ module Styles
7
+ class Error < StandardError; end
8
+ # Your code goes here...
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Boost
4
+ module Styles
5
+ VERSION = '0.1.2'
6
+ end
7
+ end
@@ -0,0 +1,172 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'rails/generators/base'
4
+ require 'active_support/core_ext/string'
5
+
6
+ module BoostStyles
7
+ module Generators
8
+ class InstallGenerator < Rails::Generators::Base
9
+ desc "Creates a .rubocop.yml config file that inherits from boost-style's .rubocop_default.yml"
10
+
11
+ def create_config_file
12
+ file_method = config_file_exists? ? :prepend : :create
13
+ send :"#{file_method}_file", config_file_path, config_file_content
14
+ end
15
+
16
+ def create_stylelint_file
17
+ return unless yes?('Do you want stylelint?')
18
+ return if stylelint_file_exists?
19
+
20
+ run('yarn add stylelint stylelint-config-standard')
21
+ create_file(stylelint_file_path, stylelint_file_content)
22
+ end
23
+
24
+ def create_haml_lint_file
25
+ return unless yes?('Do you want HAML lint?')
26
+ return if haml_lint_file_exists?
27
+
28
+ create_file(haml_lint_file_path, haml_lint_file_content)
29
+ end
30
+
31
+ def create_eslint_file
32
+ return unless yes?('Do you want ESLint?')
33
+ return if eslint_file_exists?
34
+
35
+ run('yarn add eslint')
36
+ create_file(eslint_file_path, eslint_file_content)
37
+ end
38
+
39
+ def print_instructions
40
+ say <<-TXT.strip_heredoc
41
+ -----------------------------------------
42
+ 🎉 All done! 🎉
43
+
44
+ Run rubocop in parallel to check the offenses:
45
+ -> rubocop -P
46
+ To fix the offenses, run:
47
+ -> rubocop -a
48
+ To generate todo, run:
49
+ -> rubocop --auto-gen-config
50
+
51
+ Run stylelint to check the offenses:
52
+ -> stylelint --color app/assets/stylesheets/
53
+ To fix the offenses, run:
54
+ -> stylelint --color --fix app/assets/stylesheets/
55
+
56
+ Run haml_lint to check the offenses:
57
+ -> bundle exec haml-lint app/**/*.html.haml
58
+ To fix the offenses, you need to diy
59
+ -----------------------------------------
60
+ TXT
61
+ end
62
+
63
+ private
64
+
65
+ def haml_lint_file_exists?
66
+ File.exist?(haml_lint_file_path)
67
+ end
68
+
69
+ def stylelint_file_exists?
70
+ File.exist?(stylelint_file_path)
71
+ end
72
+
73
+ def config_file_exists?
74
+ File.exist?(config_file_path)
75
+ end
76
+
77
+ def eslint_file_exists?
78
+ File.exist?(eslint_file_path)
79
+ end
80
+
81
+ def haml_lint_file_path
82
+ '.haml-lint.yml'
83
+ end
84
+
85
+ def stylelint_file_path
86
+ '.stylelintrc.yml'
87
+ end
88
+
89
+ def config_file_path
90
+ '.rubocop.yml'
91
+ end
92
+
93
+ def eslint_file_path
94
+ '.eslintrc.yml'
95
+ end
96
+
97
+ def haml_lint_file_content
98
+ <<-YAML.strip_heredoc
99
+ linters:
100
+ ImplicitDiv:
101
+ enabled: false
102
+ severity: error
103
+
104
+ LineLength:
105
+ max: 100
106
+
107
+ RuboCop:
108
+ enabled: false
109
+ YAML
110
+ end
111
+
112
+ def stylelint_file_content
113
+ <<-YAML.strip_heredoc
114
+ extends: stylelint-config-standard
115
+
116
+ rules:
117
+ # Complains about FontAwesome
118
+ font-family-no-missing-generic-family-keyword: null
119
+
120
+ at-rule-no-unknown:
121
+ - true
122
+ - ignoreAtRules:
123
+ - extend
124
+ - if
125
+ - each
126
+ - include
127
+ - mixin
128
+ - at-root
129
+ YAML
130
+ end
131
+
132
+ def config_file_content
133
+ <<-YAML.strip_heredoc
134
+ inherit_gem:
135
+ boost-styles:
136
+ - rubocop_default.yml
137
+ YAML
138
+ end
139
+
140
+ def eslint_file_content
141
+ <<-YAML.strip_heredoc
142
+ ---
143
+ env:
144
+ browser: true
145
+ es6: true
146
+ jquery: true
147
+ node: true
148
+ extends:
149
+ - standard
150
+ overrides:
151
+ files:
152
+ - '*.js''
153
+ excludedFiles:
154
+ - '*.config.js'
155
+ parserOptions:
156
+ sourceType: module
157
+ plugins: []
158
+ globals:
159
+ _: true
160
+ '$': true
161
+ ga: true
162
+ Foundation: true
163
+ rules:
164
+ no-unused-vars:
165
+ - error
166
+ - varsIgnorePattern: '_.*'
167
+ argsIgnorePattern: '_.*'
168
+ YAML
169
+ end
170
+ end
171
+ end
172
+ end
@@ -0,0 +1,10 @@
1
+ AllCops:
2
+ DisplayCopNames: true
3
+ NewCops: disable
4
+ Exclude:
5
+ - '**/templates/**/*'
6
+ - '**/vendor/**/*'
7
+ - 'actionpack/lib/action_dispatch/journey/parser.rb'
8
+ - 'railties/test/fixtures/tmp/**/*'
9
+ - 'node_modules/**/*'
10
+ - 'bin/**/*'
@@ -0,0 +1,13 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rspec
4
+
5
+ inherit_from:
6
+ - rubocop_all.yml
7
+ - rubocop_rails.yml
8
+ - rubocop_performance.yml
9
+ - rubocop_rspec.yml
10
+
11
+ - rubocop_layout.yml
12
+ - rubocop_metrics.yml
13
+ - rubocop_style.yml
@@ -0,0 +1,17 @@
1
+ # Method definitions after `private` or `protected` isolated calls need one
2
+ # extra level of indentation.
3
+ Layout/IndentationConsistency:
4
+ Enabled: true
5
+ EnforcedStyle: indented_internal_methods
6
+
7
+ # Limit lines to 80 characters.
8
+ Layout/LineLength:
9
+ Enabled: false
10
+
11
+ # Keep blank lines around attribute accessors.
12
+ Layout/EmptyLinesAroundAttributeAccessor:
13
+ Enabled: true
14
+
15
+ # Checks method call operators to not have spaces around them.
16
+ Layout/SpaceAroundMethodCallOperator:
17
+ Enabled: true
@@ -0,0 +1,42 @@
1
+ # A calculated magnitude based on number of assignments,
2
+ # branches, and conditions.
3
+ Metrics/AbcSize:
4
+ Enabled: true
5
+ Max: 54.28
6
+
7
+ # This cop checks if the length of a block exceeds some maximum value.
8
+ Metrics/BlockLength:
9
+ Enabled: false
10
+
11
+ # Avoid excessive block nesting.
12
+ Metrics/BlockNesting:
13
+ Enabled: true
14
+ Max: 4
15
+
16
+ # Avoid classes longer than 100 lines of code.
17
+ Metrics/ClassLength:
18
+ Enabled: false
19
+
20
+ # A complexity metric that is strongly correlated to the number
21
+ # of test cases needed to validate a method.
22
+ Metrics/CyclomaticComplexity:
23
+ Enabled: true
24
+ Max: 13
25
+
26
+ # Avoid methods longer than 10 lines of code.
27
+ Metrics/MethodLength:
28
+ Enabled: false
29
+
30
+ # Avoid modules longer than 100 lines of code.
31
+ Metrics/ModuleLength:
32
+ Enabled: false
33
+
34
+ # Avoid parameter lists longer than three or four parameters.
35
+ Metrics/ParameterLists:
36
+ Enabled: true
37
+ Max: 8
38
+
39
+ # A complexity metric geared towards measuring complexity for a human reader.
40
+ Metrics/PerceivedComplexity:
41
+ Enabled: true
42
+ Max: 14
@@ -0,0 +1,24 @@
1
+ Performance:
2
+ Exclude:
3
+ - '**/test/**/*'
4
+
5
+ Performance/FlatMap:
6
+ Enabled: true
7
+
8
+ Performance/RedundantMerge:
9
+ Enabled: true
10
+
11
+ Performance/StartWith:
12
+ Enabled: true
13
+
14
+ Performance/EndWith:
15
+ Enabled: true
16
+
17
+ Performance/RegexpMatch:
18
+ Enabled: true
19
+
20
+ Performance/ReverseEach:
21
+ Enabled: true
22
+
23
+ Performance/UnfreezeString:
24
+ Enabled: true
@@ -0,0 +1,2 @@
1
+ Rails:
2
+ Enabled: true
@@ -0,0 +1,21 @@
1
+ RSpec/DescribeClass:
2
+ Exclude:
3
+ - spec/features/**/**
4
+
5
+ RSpec/ExampleLength:
6
+ Exclude:
7
+ - spec/features/**/**
8
+
9
+ RSpec/ExpectActual:
10
+ Exclude:
11
+ - spec/routes/**/**
12
+ - spec/routing/**/**
13
+
14
+ RSpec/MessageSpies:
15
+ Description: Checks that message expectations are set using spies.
16
+ Enabled: true
17
+ EnforcedStyle: receive
18
+ SupportedStyles:
19
+ - have_received
20
+ - receive
21
+ StyleGuide: http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MessageSpies
@@ -0,0 +1,12 @@
1
+ Style/FrozenStringLiteralComment:
2
+ Enabled: true
3
+ EnforcedStyle: always
4
+ Exclude:
5
+ - 'actionview/test/**/*.builder'
6
+ - 'actionview/test/**/*.ruby'
7
+ - 'actionpack/test/**/*.builder'
8
+ - 'actionpack/test/**/*.ruby'
9
+ - 'activestorage/db/migrate/**/*.rb'
10
+
11
+ Style/Documentation:
12
+ Enabled: false
metadata ADDED
@@ -0,0 +1,201 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: boost-styles
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.2
5
+ platform: ruby
6
+ authors:
7
+ - Boost
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2020-06-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 6.0.1
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 6.0.1
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '13.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '13.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: haml_lint
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.33'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.33'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.8'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.8'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop-performance
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-rails
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '2'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '2'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop-rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1'
139
+ description: Centralised gem for all Boost styles configuration (Rubocop, ESLint etc...)
140
+ email:
141
+ - info@boost.co.nz
142
+ executables: []
143
+ extensions: []
144
+ extra_rdoc_files: []
145
+ files:
146
+ - ".gitignore"
147
+ - ".haml-lint.yml"
148
+ - ".rspec"
149
+ - ".rubocop.yml"
150
+ - ".rubocop_todo.yml"
151
+ - ".ruby-version"
152
+ - ".travis.yml"
153
+ - CHANGELOG.md
154
+ - CODE_OF_CONDUCT.md
155
+ - Gemfile
156
+ - Gemfile.lock
157
+ - LICENSE.txt
158
+ - README.md
159
+ - Rakefile
160
+ - bin/console
161
+ - bin/setup
162
+ - boost-styles.gemspec
163
+ - lib/boost/styles.rb
164
+ - lib/boost/styles/version.rb
165
+ - lib/generators/boost_styles/install_generator.rb
166
+ - rubocop_all.yml
167
+ - rubocop_default.yml
168
+ - rubocop_layout.yml
169
+ - rubocop_metrics.yml
170
+ - rubocop_performance.yml
171
+ - rubocop_rails.yml
172
+ - rubocop_rspec.yml
173
+ - rubocop_style.yml
174
+ homepage: https://github.com/boost/boost-styles
175
+ licenses:
176
+ - MIT
177
+ metadata:
178
+ allowed_push_host: https://rubygems.org
179
+ homepage_uri: https://github.com/boost/boost-styles
180
+ source_code_uri: https://github.com/boost/boost-styles
181
+ changelog_uri: https://github.com/boost/boost-styles/CHANGELOG.md
182
+ post_install_message:
183
+ rdoc_options: []
184
+ require_paths:
185
+ - lib
186
+ required_ruby_version: !ruby/object:Gem::Requirement
187
+ requirements:
188
+ - - ">="
189
+ - !ruby/object:Gem::Version
190
+ version: '0'
191
+ required_rubygems_version: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - ">="
194
+ - !ruby/object:Gem::Version
195
+ version: '0'
196
+ requirements: []
197
+ rubygems_version: 3.0.3
198
+ signing_key:
199
+ specification_version: 4
200
+ summary: Shared Boost styles configuration
201
+ test_files: []