rubocop-traitify-test 1.3.0.pre.alpha.test.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: af82601183a29b6cd6dcbed9563c862ead7b54af46fdd46c1f6f94bf032be634
4
+ data.tar.gz: 88606d412eaadd8187d182c7959e3801fc9c655997828885b772ce0b9edff5d2
5
+ SHA512:
6
+ metadata.gz: 4f2aa75b162ebb47639454e9d54a12865488434e08de6590475d8720555699ca7990d05c754b71014a70492de69db922669ee805acdc00daaa53de1a9c82649b
7
+ data.tar.gz: 1531f3602d76bca92f6df7e9ce68463f44b265cf763ae784154ee8f49d81eadbb4cebcb5339457fb3684335487494002c9cecd7ae8f3f0e6d6352b2357c4dfe9
@@ -0,0 +1,2 @@
1
+ require:
2
+ - ./lib/rubocop-traitify.rb
data/README.md ADDED
@@ -0,0 +1,22 @@
1
+ # RuboCop Traitify
2
+
3
+ Traitify's default configuration for [RuboCop](https://github.com/rubocop-hq/rubocop).
4
+
5
+ ## Installation
6
+
7
+ ```
8
+ gem "rubocop-traitify"
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ Add the following to `.rubocop.yml`
14
+
15
+ ```
16
+ inherit_gem:
17
+ rubocop-traitify: .rubocop_traitify.yml
18
+ ```
19
+
20
+ ## Credit
21
+
22
+ Heavily influenced by (as well as dependent on) Airbnb's [configuration/plugin](https://github.com/airbnb/ruby)
@@ -0,0 +1,19 @@
1
+ AllCops:
2
+ Exclude:
3
+ - bin/yarn
4
+ - db/schema.rb
5
+ - lib/protobufs/traitify
6
+ - lib/protobufs/traitify/**
7
+ - lib/protobufs/traitify/**/*
8
+
9
+ inherit_from:
10
+ - ./rubocop-airbnb.yml
11
+ - ./rubocop-layout.yml
12
+ - ./rubocop-lint.yml
13
+ - ./rubocop-rails.yml
14
+ - ./rubocop-style.yml
15
+
16
+ # TODO: Remove. Move to specific rules that need it
17
+ inherit_mode:
18
+ merge:
19
+ - Exclude
@@ -0,0 +1,17 @@
1
+ require:
2
+ - rubocop-airbnb
3
+
4
+ # NOTE: Cop is too restrictive
5
+ Airbnb/SimpleModifierConditional:
6
+ Enabled: false
7
+
8
+ # NOTE: Cop is too restrictive
9
+ Airbnb/SimpleUnless:
10
+ Enabled: false
11
+
12
+ # TODO REMOVE IF SATISFIED IN 8.0.0
13
+ # Capybara/CurrentPathExpectation:
14
+
15
+ # FactoryBot/AttributeDefinedStatically:
16
+
17
+ # FactoryBot/CreateList:
@@ -0,0 +1,33 @@
1
+ Layout/ArgumentAlignment:
2
+ Enabled: true
3
+ EnforcedStyle: with_fixed_indentation
4
+
5
+ Layout/CaseIndentation:
6
+ Enabled: true
7
+ EnforcedStyle: end
8
+
9
+ Layout/DotPosition:
10
+ Enabled: true
11
+ EnforcedStyle: leading
12
+
13
+ Layout/EndAlignment:
14
+ Enabled: true
15
+ EnforcedStyleAlignWith: start_of_line
16
+
17
+ Layout/FirstMethodParameterLineBreak:
18
+ Enabled: true
19
+
20
+ Layout/MultilineMethodParameterLineBreaks:
21
+ Enabled: true
22
+
23
+ Layout/ParameterAlignment:
24
+ Enabled: true
25
+ EnforcedStyle: with_fixed_indentation
26
+
27
+ Layout/SpaceBeforeBlockBraces:
28
+ Enabled: true
29
+ EnforcedStyle: no_space
30
+
31
+ Layout/SpaceInsideHashLiteralBraces:
32
+ Enabled: true
33
+ EnforcedStyle: no_space
@@ -0,0 +1,3 @@
1
+ # NOTE: Allows for concise readable code
2
+ Lint/AssignmentInCondition:
3
+ Enabled: false
@@ -0,0 +1,11 @@
1
+ # NOTE: Cop is too restrictive
2
+ Rails/HelperInstanceVariable:
3
+ Enabled: false
4
+
5
+ # NOTE: Rendering inline is useful for 1 line views
6
+ Rails/RenderInline:
7
+ Enabled: false
8
+
9
+ Rails/WhereExists:
10
+ Enabled: true
11
+ EnforcedStyle: where
@@ -0,0 +1,57 @@
1
+ # NOTE: Helpful for chaining and simplicity
2
+ Style/BlockDelimiters:
3
+ Enabled: false
4
+
5
+ Style/MixinUsage:
6
+ Enabled: true
7
+ Exclude:
8
+ - bin/*
9
+
10
+ # NOTE: Easy to understand
11
+ Style/MultilineIfModifier:
12
+ Enabled: false
13
+
14
+ # NOTE: Easy to understand
15
+ Style/MultilineTernaryOperator:
16
+ Enabled: false
17
+
18
+ # NOTE: Prefer an array
19
+ Style/PercentLiteralDelimiters:
20
+ Enabled: false
21
+
22
+ Style/RaiseArgs:
23
+ Enabled: true
24
+ EnforcedStyle: compact
25
+
26
+ # NOTE: Easy to understand
27
+ Style/RescueModifier:
28
+ Enabled: false
29
+
30
+ Style/Semicolon:
31
+ AllowAsExpressionSeparator: true
32
+ Enabled: true
33
+
34
+ Style/StringLiterals:
35
+ Enabled: true
36
+ EnforcedStyle: double_quotes
37
+
38
+ Style/StringLiteralsInInterpolation:
39
+ Enabled: true
40
+ EnforcedStyle: double_quotes
41
+
42
+ Style/SymbolArray:
43
+ Enabled: true
44
+ EnforcedStyle: brackets
45
+ MinSize: 1
46
+
47
+ Style/TrailingCommaInArrayLiteral:
48
+ Enabled: true
49
+ EnforcedStyleForMultiline: no_comma
50
+
51
+ Style/TrailingCommaInHashLiteral:
52
+ Enabled: true
53
+ EnforcedStyleForMultiline: no_comma
54
+
55
+ Style/WordArray:
56
+ Enabled: true
57
+ EnforcedStyle: brackets
@@ -0,0 +1,21 @@
1
+ # Straight up ripped from Airbnb ripped from Rspec
2
+ # https://github.com/airbnb/ruby/blob/master/rubocop-airbnb/lib/rubocop/airbnb/inject.rb
3
+ # https://github.com/nevir/rubocop-rspec/blob/master/lib/rubocop/rspec/inject.rb
4
+ require "yaml"
5
+
6
+ module RuboCop
7
+ module Traitify
8
+ # Because RuboCop doesn't yet support plugins, we have to monkey patch in a
9
+ # bit of our configuration.
10
+ module Inject
11
+ def self.defaults!
12
+ path = CONFIG_DEFAULT.to_s
13
+ hash = ConfigLoader.load_file(path).to_hash
14
+ config = Config.new(hash, path)
15
+ puts "configuration from #{path}" if ConfigLoader.debug?
16
+ config = ConfigLoader.merge_with_default(config, path)
17
+ ConfigLoader.instance_variable_set(:@default_configuration, config)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,5 @@
1
+ module RuboCop
2
+ module Traitify
3
+ VERSION = "1.3.0.pre.alpha.test.1"
4
+ end
5
+ end
@@ -0,0 +1,13 @@
1
+ require "pathname"
2
+ require "psych"
3
+
4
+ module RuboCop
5
+ module Traitify
6
+ PROJECT_ROOT =
7
+ Pathname.new(__FILE__).parent.parent.parent.expand_path.freeze
8
+ CONFIG_DEFAULT = PROJECT_ROOT.join("config", "default.yml").freeze
9
+ CONFIG = Psych.safe_load(CONFIG_DEFAULT.read).freeze
10
+
11
+ private_constant(*constants(false))
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ require "pathname"
2
+ require "yaml"
3
+
4
+ require "rubocop"
5
+ require "rubocop/traitify"
6
+ require "rubocop/traitify/inject"
7
+ require "rubocop/traitify/version"
8
+
9
+ RuboCop::Traitify::Inject.defaults!
@@ -0,0 +1,28 @@
1
+ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
2
+ require "rubocop/traitify/version"
3
+
4
+ Gem::Specification.new do |spec|
5
+ spec.name = "rubocop-traitify-test"
6
+ spec.summary = "Default Rubocop config for Traitify Apps"
7
+ spec.description = <<-EOF
8
+ Traitify's Ruby configuration for Rubocop. Heavily influenced by (as well as dependent on)
9
+ Airbnb's https://github.com/airbnb/ruby
10
+ EOF
11
+ spec.authors = ["Tom Prats", "Jack Burum"]
12
+ spec.email = ["tom.prats@paradox.ai", "jack.burum@paradox.ai"]
13
+ spec.homepage = "https://github.com/traitify/rubocop-traitify"
14
+ spec.license = "MIT"
15
+ spec.version = RuboCop::Traitify::VERSION
16
+ spec.platform = Gem::Platform::RUBY
17
+ spec.required_ruby_version = ">= 2.7"
18
+ spec.require_paths = ["lib"]
19
+ spec.files = Dir[
20
+ "{config,lib}/**/*",
21
+ "*.md",
22
+ "*.gemspec",
23
+ ".rubocop_traitify.yml",
24
+ "Gemfile"
25
+ ]
26
+
27
+ spec.add_dependency("rubocop-airbnb", "~> 8.0.0")
28
+ end
metadata ADDED
@@ -0,0 +1,74 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rubocop-traitify-test
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.3.0.pre.alpha.test.1
5
+ platform: ruby
6
+ authors:
7
+ - Tom Prats
8
+ - Jack Burum
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2025-03-29 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rubocop-airbnb
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: 8.0.0
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: 8.0.0
28
+ description: |2
29
+ Traitify's Ruby configuration for Rubocop. Heavily influenced by (as well as dependent on)
30
+ Airbnb's https://github.com/airbnb/ruby
31
+ email:
32
+ - tom.prats@paradox.ai
33
+ - jack.burum@paradox.ai
34
+ executables: []
35
+ extensions: []
36
+ extra_rdoc_files: []
37
+ files:
38
+ - ".rubocop_traitify.yml"
39
+ - README.md
40
+ - config/default.yml
41
+ - config/rubocop-airbnb.yml
42
+ - config/rubocop-layout.yml
43
+ - config/rubocop-lint.yml
44
+ - config/rubocop-rails.yml
45
+ - config/rubocop-style.yml
46
+ - lib/rubocop-traitify.rb
47
+ - lib/rubocop/traitify.rb
48
+ - lib/rubocop/traitify/inject.rb
49
+ - lib/rubocop/traitify/version.rb
50
+ - rubocop-traitify-test.gemspec
51
+ homepage: https://github.com/traitify/rubocop-traitify
52
+ licenses:
53
+ - MIT
54
+ metadata: {}
55
+ post_install_message:
56
+ rdoc_options: []
57
+ require_paths:
58
+ - lib
59
+ required_ruby_version: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: '2.7'
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">"
67
+ - !ruby/object:Gem::Version
68
+ version: 1.3.1
69
+ requirements: []
70
+ rubygems_version: 3.1.4
71
+ signing_key:
72
+ specification_version: 4
73
+ summary: Default Rubocop config for Traitify Apps
74
+ test_files: []