diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..1602f7b --- /dev/null +++ b/README.md @@ -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) | diff --git a/javascript/package.json b/javascript/package.json index 5b3eb7e..030610d 100644 --- a/javascript/package.json +++ b/javascript/package.json @@ -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 ", "license": "MIT", "peerDependencies": { diff --git a/ruby/rubocop-cache-ventures.gemspec b/ruby/rubocop-cache-ventures.gemspec new file mode 100644 index 0000000..8587ffb --- /dev/null +++ b/ruby/rubocop-cache-ventures.gemspec @@ -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 = 'jclusso@gmail.com' + 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 diff --git a/ruby/rubocop.yml b/ruby/rubocop.yml new file mode 100644 index 0000000..faf0913 --- /dev/null +++ b/ruby/rubocop.yml @@ -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