Skip to content

Commit

Permalink
Merge branch 'release/0.1.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
akhilgkrishnan committed Mar 23, 2022
2 parents ca944be + d579d85 commit e2265a1
Show file tree
Hide file tree
Showing 104 changed files with 1,841 additions and 479 deletions.
6 changes: 4 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}
},
"plugins": [
"react",
"react",
"import",
"@typescript-eslint"
],
Expand All @@ -61,6 +61,7 @@
"window": true
},
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"object-curly-newline": "off",
"comma-dangle": ["error", "never"],
"indent": ["warn", 2, { "SwitchCase": 1 }],
Expand All @@ -69,6 +70,8 @@
"object-curly-spacing": [1, "always"],
"semi": 2,
"array-bracket-spacing": [2, "never"],
"arrow-body-style": ["error", "as-needed"],
"func-style": ["error", "expression"],
"space-before-function-paren": 2,
"no-multiple-empty-lines": ["warn", { "max": 1, "maxEOF": 1 }],
"quotes": ["warn", "double"],
Expand All @@ -93,4 +96,3 @@
}]
}
}

3 changes: 0 additions & 3 deletions .github/workflows/validations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ jobs:
- name: Run Eslint
run: |
npx eslint "./app/javascript/**/*.{ts,tsx,js,jsx,json}"
- name: Run Prettier
run: |
npx prettier "./app/javascript/**/*.{ts,tsx,js,jsx,json}"
- name: Cypress install
uses: cypress-io/github-action@v2
with:
Expand Down
15 changes: 0 additions & 15 deletions .prettierrc.js

This file was deleted.

248 changes: 241 additions & 7 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,29 @@ Performance/DeleteSuffix:
# RSpec cops from rubocop-rspec
# https://github.com/rubocop-hq/rubocop-rspec/blob/master/config/default.yml


RSpec/Be:
Description: Check for expectations where be is used without argument.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Be

RSpec/ContextMethod:
Description: context should not be used for specifying methods.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContextMethod

RSpec/ContextWording:
Description: Checks that context docstring starts with an allowed prefix.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ContextWording
Prefixes:
- when
- with
- without
- if
- unless
- for

RSpec/DescribeClass:
Description: Check that the first argument to the top level describe is a constant.
Enabled: true
Expand All @@ -318,42 +341,253 @@ RSpec/DescribedClassModuleWrapping:
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribedClassModuleWrapping

RSpec/DescribeSymbol:
Description: Avoid describing symbols.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/DescribeSymbol

RSpec/EmptyExampleGroup:
Description: Checks if an example group does not include any tests.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyExampleGroup

RSpec/EmptyHook:
Description: Checks for empty before and after hooks.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyHook

RSpec/EmptyLineAfterExample:
Description: Checks if there is an empty line after example blocks.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterExample

RSpec/EmptyLineAfterExampleGroup:
Description: Checks if there is an empty line after example group blocks.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterExampleGroup

RSpec/EmptyLineAfterFinalLet:
Description: Checks if there is an empty line after the last let block.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterFinalLet

RSpec/EmptyLineAfterHook:
Description: Checks if there is an empty line after hook blocks.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterHook

RSpec/EmptyLineAfterSubject:
Description: Checks if there is an empty line after subject block.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyLineAfterSubject

RSpec/ExampleLength:
Description: Checks for long examples.
Enabled: true
Max: 15
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleLength

RSpec/ExampleWithoutDescription:
Description: Checks for examples without a description.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWithoutDescription

RSpec/ExampleWording:
Description: Checks for common mistakes in example descriptions.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExampleWording

RSpec/ExcessiveDocstringSpacing:
Description: Checks for excessive whitespace in example descriptions.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExcessiveDocstringSpacing

RSpec/ExpectActual:
Description: Checks for expect(…​) calls containing literal values.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectActual

RSpec/ExpectChange:
Description: Checks for consistent style of change matcher.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectChange

RSpec/ExpectOutput:
Description: Checks for opportunities to use expect { …​ }.to output.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectOutput

RSpec/ExpectInHook:
Description: Do not use expect in hooks such as before.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ExpectInHook

RSpec/FilePath:
Description: Checks that spec file paths are consistent and well-formed.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FilePath

RSpec/HookArgument:
Description: Checks the arguments passed to before, around, and after.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HookArgument

RSpec/HooksBeforeExamples:
Description: Checks for before/around/after hooks that come after an example.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/HooksBeforeExamples

RSpec/IdenticalEqualityAssertion:
Description: Checks for equality assertions with identical expressions on both sides.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/IdenticalEqualityAssertion

RSpec/ImplicitExpect:
Description: Check that a consist implict expectation style is used.
Enabled: true
EnforcedStyle: is_expected
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitExpect

RSpec/ImplicitSubject:
Description: Checks for usage of implicit subject (is_expected / should).
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ImplicitSubject

RSpec/ItBehavesLike:
Description: Checks that only one it_behaves_like style is used.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/ItBehavesLike

RSpec/LetBeforeExamples:
Description: Checks for let definitions that come after an example.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetBeforeExamples

RSpec/LetSetup:
Description: Checks unreferenced let! calls being used for test setup.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/LetSetup

RSpec/MessageExpectation:
Description: Checks for consistent message expectation style.
Enabled: true
EnforcedStyle: allow

RSpec/MultipleMemoizedHelpers:
Description: Checks if example groups contain too many `let` and `subject` calls.
Enabled: false
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleMemoizedHelpers
Max: 10

RSpec/MissingExampleGroupArgument:
Description: Checks that the first argument to an example group is not empty.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MissingExampleGroupArgument

RSpec/MultipleDescribes:
Description: Checks for multiple top-level example groups.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleDescribes

RSpec/MissingExampleGroupArgument:
Description: Checks that the first argument to an example group is not empty.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MissingExampleGroupArgument

RSpec/MultipleDescribes:
Description: Checks for multiple top-level example groups.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleDescribes

RSpec/MultipleExpectations:
Description: Checks if examples contain too many `expect` calls.
Enabled: true
Max: 8
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleExpectations

RSpec/MultipleSubjects:
Description: Checks if an example group defines subject multiple times.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/MultipleSubjects

RSpec/NotToNot:
Description: Checks for consistent method usage for negating expectations.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot

RSpec/RepeatedDescription:
Description: Check for repeated description strings in example groups.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription

RSpec/RepeatedExampleGroupDescription:
Description: Check for repeated example group descriptions.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExampleGroupDescription

RSpec/RepeatedIncludeExample:
Description: Check for repeated include of shared examples.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedIncludeExample

RSpec/SharedContext:
Description: Checks for proper shared_context and shared_examples usage.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SharedContext

RSpec/SharedExamples:
Description: Enforces use of string to titleize shared examples.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/SharedExamples

RSpec/UnspecifiedException:
Description: Checks for a specified error in checking raised errors.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/UnspecifiedException

RSpec/VariableDefinition:
Description: Checks that memoized helpers names are symbols or strings.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VariableDefinition

RSpec/VariableName:
Description: Checks that memoized helper names use the configured style.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VariableName

RSpec/VoidExpect:
Description: This cop checks void expect().
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/VoidExpect

# RSpec x Rails
RSpec/Rails/AvoidSetupHook:
Description: Checks that tests use RSpec `before` hook over Rails `setup` method.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/AvoidSetupHook

RSpec/ImplicitExpect:
Description: Check that a consist implict expectation style is used.
RSpec/Rails/HttpStatus:
Description: Enforces use of symbolic or numeric value to describe HTTP status.
Enabled: true
EnforcedStyle: is_expected
SupportedStyles:
- is_expected
- should
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/Rails/HttpStatus

# RSpec x FactoryBot
RSpec/FactoryBot/AttributeDefinedStatically:
Description: Always declare attribute values as blocks.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/AttributeDefinedStatically

RSpec/FactoryBot/CreateList:
Description: Checks for create_list usage.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/CreateList

RSpec/FactoryBot/FactoryClassName:
Description: Use string value when setting the class attribute explicitly.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/FactoryClassName

RSpec/FactoryBot/SyntaxMethods:
Description: Use shorthands from FactoryBot::Syntax::Methods in your specs.
Enabled: true
StyleGuide: https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/FactoryBot/SyntaxMethods
2 changes: 0 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@
],
"editor.tabSize": 2,
"javascript.updateImportsOnFileMove.enabled": "never",
"workbench.iconTheme": "material-icon-theme",
"workbench.colorTheme": "Oceanic Plus"
}
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ group :development, :test do

# Use Faker for fake data
gem "faker"

# Added rails controller to use render_template
gem "rails-controller-testing", "~> 1.0", ">= 1.0.5"
end

group :development do
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,10 @@ GEM
activesupport (= 7.0.1)
bundler (>= 1.15.0)
railties (= 7.0.1)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
activesupport (>= 5.0.1.rc1)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
Expand Down Expand Up @@ -476,6 +480,7 @@ DEPENDENCIES
pundit (~> 2.2)
rack-mini-profiler (>= 2.3.3)
rails (~> 7.0.1)
rails-controller-testing (~> 1.0, >= 1.0.5)
ransack
react-rails
redis (~> 4.0)
Expand Down
1 change: 1 addition & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# frozen_string_literal: true

class ApplicationController < ActionController::Base
include DeviseWhitelist
include PunditHelper
include ErrorHandler
include CurrentCompanyConcern
Expand Down
Loading

0 comments on commit e2265a1

Please sign in to comment.