Skip to content

Commit

Permalink
Added RuboCop and updated JS packages.json
Browse files Browse the repository at this point in the history
  • Loading branch information
jclusso committed Feb 28, 2024
1 parent 6af8c64 commit e337d68
Show file tree
Hide file tree
Showing 5 changed files with 387 additions and 1 deletion.
File renamed without changes.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Cache Ventures Code Style

This repository contains linter configuration packages used by the development
team at Cache Ventures.

| Language | Linter | Package |
|------------|---------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| Ruby | [RuboCop](/ruby/rubocop.yml) | [![Version](https://badge.fury.io/rb/rubocop-cache-ventures.svg)](https://rubygems.org/gems/rubocop-cache-ventures) |
| JavaScript | [ESLint](/javascript/index.js) | [![Version](https://img.shields.io/npm/v/eslint-config-cache-ventures.svg)](https://www.npmjs.org/package/eslint-config-cache-ventures) |
7 changes: 6 additions & 1 deletion javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
"version": "1.0.0",
"description": "Cache Venture's ESLint config.",
"main": "index.js",
"repository": "https://github.com/cacheventures/code-style",
"homepage": "https://github.com/cacheventures/code-style",
"repository": {
"type": "git",
"url": "git+https://github.com/cacheventures/code-style.git",
"directory": "javascript"
},
"author": "Jarrett Lusso <[email protected]>",
"license": "MIT",
"peerDependencies": {
Expand Down
19 changes: 19 additions & 0 deletions ruby/rubocop-cache-ventures.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Gem::Specification.new do |s|
s.name = 'rubocop-cache-ventures'
s.summary = 'Cache Ventures RuboCop config.'
s.author = 'Jarrett Lusso'
s.email = '[email protected]'
s.homepage = 'https://github.com/cacheventures/code-style'

s.license = 'MIT'

s.version = '1.0.1'
s.platform = Gem::Platform::RUBY

s.add_dependency 'rubocop'
s.add_dependency 'rubocop-rails'
s.add_dependency 'rubocop-performance'
s.add_dependency 'rubocop-minitest'

s.files = %w[rubocop.yml]
end
353 changes: 353 additions & 0 deletions ruby/rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,353 @@
require:
- rubocop-minitest
- rubocop-performance
- rubocop-rails

inherit_mode:
merge:
- Exclude

AllCops:
NewCops: enable
DisabledByDefault: true
SuggestExtensions: false
Exclude:
- data/**/*
- db/**/*
- log/**/*
- node_modules/**/*
- notes/**/*
- public/**/*
- scripts/**/*
- tmp/**/*
- vendor/**/*

Bundler:
Enabled: true

Bundler/OrderedGems:
Enabled: false

Lint:
Enabled: true

Lint/AmbiguousBlockAssociation:
Exclude:
- test/**/*

Lint/DuplicateBranch:
Enabled: false

Lint/MissingSuper:
Enabled: false

Lint/NestedMethodDefinition:
Exclude:
- test/**/*

Lint/NoReturnInBeginEndBlocks:
Enabled: false

Lint/ShadowingOuterLocalVariable:
Enabled: false

Lint/SymbolConversion:
Enabled: false

Lint/UnusedBlockArgument:
Enabled: false

Naming/ClassAndModuleCamelCase:
Enabled: true

Naming/ConstantName:
Enabled: true

Naming/FileName:
Enabled: true

Naming/HeredocDelimiterCase:
Enabled: true

Naming/MethodName:
Enabled: true

Naming/VariableName:
Enabled: true

Security:
Enabled: true

Style/ReturnNil:
Enabled: true

Minitest/AssertEqual:
Enabled: true

Minitest/AssertNil:
Enabled: true

Minitest/AssertRaisesCompoundBody:
Enabled: true

Minitest/AssertTruthy:
Enabled: true

Minitest/AssertWithExpectedArgument:
Enabled: true

Minitest/AssertionInLifecycleHook:
Enabled: true

Minitest/DuplicateTestRun:
Enabled: true

Minitest/LifecycleHooksOrder:
Enabled: true

Minitest/LiteralAsActualArgument:
Enabled: true

Minitest/NoAssertions:
Enabled: true

Minitest/NonPublicTestMethod:
Enabled: true

Minitest/RefuteEqual:
Enabled: true

Minitest/RefuteFalse:
Enabled: true

Minitest/ReturnInTestMethod:
Enabled: true

Minitest/SkipWithoutReason:
Enabled: true

Minitest/TestFileName:
Enabled: true

Minitest/TestMethodName:
Enabled: true

Minitest/UnreachableAssertion:
Enabled: true

Minitest/UnspecifiedException:
Enabled: true

Minitest/UselessAssertion:
Enabled: true

Performance/Casecmp:
Enabled: true

Performance/CollectionLiteralInLoop:
Enabled: true

Performance/Count:
Enabled: true

Performance/DeletePrefix:
Enabled: true

Performance/DeleteSuffix:
Enabled: true

Performance/Detect:
Enabled: true

Performance/DoubleStartEndWith:
Enabled: true

Performance/EndWith:
Enabled: true

Performance/FlatMap:
Enabled: true

Performance/InefficientHashSearch:
Enabled: true

Performance/RedundantBlockCall:
Enabled: true

Performance/RedundantMatch:
Enabled: true

Performance/RedundantMerge:
Enabled: true

Performance/RegexpMatch:
Enabled: true

Performance/ReverseEach:
Enabled: true

Performance/Size:
Enabled: true

Performance/StartWith:
Enabled: true

Performance/StringReplacement:
Enabled: true

Performance/UriDefaultParser:
Enabled: true

Rails/ActionControllerTestCase:
Enabled: true

Rails/ActionFilter:
Enabled: true

Rails/ActiveRecordAliases:
Enabled: true

Rails/ActiveRecordOverride:
Enabled: true

Rails/ActiveSupportAliases:
Enabled: true

Rails/ApplicationController:
Enabled: true

Rails/ApplicationMailer:
Enabled: true

Rails/AssertNot:
Enabled: true

Rails/BelongsTo:
Enabled: true

Rails/ContentTag:
Enabled: true

Rails/DefaultScope:
Enabled: true

Rails/DuplicateAssociation:
Enabled: true

Rails/DuplicateScope:
Enabled: true

Rails/DurationArithmetic:
Enabled: true

Rails/DynamicFindBy:
Enabled: true

Rails/EagerEvaluationLogMessage:
Enabled: true

Rails/EnumHash:
Enabled: true

Rails/EnumUniqueness:
Enabled: true

Rails/EnvironmentComparison:
Enabled: true

Rails/Exit:
Enabled: true

Rails/FindBy:
Enabled: true

Rails/FindById:
Enabled: true

Rails/HasManyOrHasOneDependent:
Enabled: true

Rails/HelperInstanceVariable:
Enabled: true

Rails/HttpPositionalArguments:
Enabled: true

Rails/HttpStatus:
Enabled: true

Rails/I18nLazyLookup:
Enabled: true

Rails/I18nLocaleTexts:
Enabled: true

Rails/IgnoredSkipActionFilterOption:
Enabled: true

Rails/InverseOf:
Enabled: true

Rails/LexicallyScopedActionFilter:
Enabled: true

Rails/LinkToBlank:
Enabled: true

Rails/MailerName:
Enabled: true

Rails/MatchRoute:
Enabled: true

Rails/Output:
Enabled: true

Rails/OutputSafety:
Enabled: true

Rails/Pick:
Enabled: true

Rails/Pluck:
Enabled: true

Rails/PluralizationGrammar:
Enabled: true

Rails/ReadWriteAttribute:
Enabled: true

Rails/RedundantAllowNil:
Enabled: true

Rails/RedundantForeignKey:
Enabled: true

Rails/ReflectionClassName:
Enabled: true

Rails/RelativeDateConstant:
Enabled: true

Rails/RequestReferer:
Enabled: true
EnforcedStyle: referrer

Rails/SafeNavigation:
Enabled: true

Rails/SafeNavigationWithBlank:
Enabled: true

Rails/ScopeArgs:
Enabled: true

Rails/ShortI18n:
Enabled: true

Rails/UniqBeforePluck:
Enabled: true

Rails/UniqueValidationWithoutIndex:
Enabled: true

0 comments on commit e337d68

Please sign in to comment.