This repository has been archived by the owner on Jan 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Rubocop and run Linters on Test Action (#56)
Add Rubocup and Eslint runs on test
- Loading branch information
1 parent
973d72e
commit 1633cac
Showing
42 changed files
with
545 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,227 @@ | ||
AllCops: | ||
TargetRubyVersion: 3.2.2 | ||
DisplayCopNames: true | ||
NewCops: enable | ||
Exclude: | ||
- 'node_modules/**/*' | ||
- 'Frontend/**/*' | ||
- 'bin/**/*' | ||
- 'vendor/**/*' | ||
|
||
Bundler/OrderedGems: | ||
Enabled: false | ||
|
||
Lint/EmptyWhen: | ||
Enabled: false | ||
|
||
Lint/UnusedBlockArgument: | ||
Enabled: false | ||
|
||
Lint/UnusedMethodArgument: | ||
Enabled: false | ||
|
||
Naming/AccessorMethodName: | ||
Enabled: false | ||
|
||
Style/Alias: | ||
Enabled: false | ||
|
||
Style/EmptyMethod: | ||
EnforcedStyle: expanded | ||
|
||
Style/RedundantSelf: | ||
Enabled: false | ||
|
||
Style/SafeNavigation: | ||
Enabled: false | ||
|
||
Style/StringLiterals: | ||
# EnforcedStyle: double_quotes | ||
Enabled: false | ||
|
||
Style/TrailingCommaInArguments: | ||
# If `comma`, the cop requires a comma after the last argument, but only for | ||
# parenthesized method calls where each argument is on its own line. | ||
# If `consistent_comma`, the cop requires a comma after the last argument, | ||
# for all parenthesized method calls with arguments. | ||
EnforcedStyleForMultiline: comma | ||
|
||
Style/TrailingCommaInArrayLiteral: | ||
# If `comma`, the cop requires a comma after the last argument, but only for | ||
# parenthesized method calls where each argument is on its own line. | ||
# If `consistent_comma`, the cop requires a comma after the last argument, | ||
# for all parenthesized method calls with arguments. | ||
EnforcedStyleForMultiline: comma | ||
|
||
Style/TrailingCommaInHashLiteral: | ||
# If `comma`, the cop requires a comma after the last item in an array or | ||
# hash, but only when each item is on its own line. | ||
# If `consistent_comma`, the cop requires a comma after the last item of all | ||
# non-empty array and hash literals. | ||
EnforcedStyleForMultiline: comma | ||
|
||
Style/GuardClause: | ||
Enabled: false | ||
|
||
Metrics/AbcSize: | ||
Enabled: false | ||
|
||
Metrics/BlockLength: | ||
Enabled: false | ||
|
||
Metrics/BlockNesting: | ||
Enabled: false | ||
|
||
Metrics/ClassLength: | ||
Enabled: false | ||
|
||
Metrics/CyclomaticComplexity: | ||
Max: 23 | ||
|
||
Metrics/ParameterLists: | ||
Max: 5 | ||
CountKeywordArgs: false | ||
|
||
Metrics/PerceivedComplexity: | ||
Max: 25 | ||
|
||
Layout/LineLength: | ||
Max: 245 | ||
|
||
Metrics/MethodLength: | ||
Enabled: false | ||
|
||
Metrics/ModuleLength: | ||
Enabled: false | ||
|
||
Naming/MemoizedInstanceVariableName: | ||
Enabled: false | ||
|
||
Style/AccessModifierDeclarations: | ||
Enabled: false | ||
|
||
Style/AsciiComments: | ||
Enabled: false | ||
|
||
Style/BlockDelimiters: | ||
Enabled: false | ||
|
||
Style/ClassAndModuleChildren: | ||
Enabled: false | ||
|
||
Style/ClassVars: | ||
Enabled: false | ||
|
||
Style/ConditionalAssignment: | ||
Enabled: false | ||
|
||
Style/Documentation: | ||
Enabled: false | ||
|
||
Style/DoubleNegation: | ||
Enabled: false | ||
|
||
Style/EmptyElse: | ||
EnforcedStyle: empty | ||
|
||
Style/IfInsideElse: | ||
Enabled: false | ||
|
||
Style/IfUnlessModifier: | ||
Enabled: false | ||
|
||
Style/InverseMethods: | ||
Enabled: false | ||
|
||
Style/Lambda: | ||
Enabled: false | ||
|
||
Style/MultilineBlockChain: | ||
Enabled: false | ||
|
||
Style/NegatedIf: | ||
Enabled: false | ||
|
||
Style/Next: | ||
Enabled: false | ||
|
||
Style/NumericPredicate: | ||
Enabled: false | ||
|
||
Style/PercentLiteralDelimiters: | ||
Enabled: false | ||
|
||
Style/PerlBackrefs: | ||
Enabled: false | ||
|
||
Style/RaiseArgs: | ||
EnforcedStyle: compact | ||
|
||
Style/RedundantParentheses: | ||
Enabled: false | ||
|
||
Style/SignalException: | ||
EnforcedStyle: only_raise | ||
|
||
Layout/SpaceAroundOperators: | ||
Enabled: false | ||
|
||
Layout/IndentationConsistency: | ||
EnforcedStyle: indented_internal_methods | ||
|
||
Style/StringLiteralsInInterpolation: | ||
Enabled: false | ||
|
||
Style/SymbolArray: | ||
Enabled: false | ||
|
||
Style/WordArray: | ||
Enabled: false | ||
|
||
Style/SymbolProc: | ||
Enabled: false | ||
|
||
Naming/PredicateName: | ||
Enabled: false | ||
|
||
Naming/BlockParameterName: | ||
Enabled: false | ||
|
||
Naming/MethodParameterName: | ||
Enabled: false | ||
|
||
Style/YodaCondition: | ||
Enabled: false | ||
|
||
Style/FormatStringToken: | ||
Enabled: false | ||
|
||
Layout/EmptyLineAfterGuardClause: | ||
Enabled: false | ||
|
||
Lint/EmptyFile: | ||
Exclude: | ||
- 'db/seeds.rb' | ||
|
||
# We have too many event IDs and Comp Years with numbers in them | ||
Naming/VariableNumber: | ||
Enabled: false | ||
|
||
# If an external library requires us to use terms like "blacklist", | ||
# we have no choice but to follow their conventions until they update | ||
Naming/InclusiveLanguage: | ||
Exclude: | ||
- 'config/**/*' | ||
|
||
Style/OpenStructUse: | ||
Exclude: | ||
- 'spec/lib/middlewares/warden_user_logger_spec.rb' | ||
|
||
Style/HashSyntax: | ||
EnforcedShorthandSyntax: never | ||
|
||
# These AWS Clients are set in the initializer | ||
Style/GlobalVars: | ||
AllowedVariables: | ||
- $sqs | ||
- $dynamodb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
# Add your own tasks in files placed in lib/tasks ending in .rake, | ||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
|
||
require_relative "config/application" | ||
require_relative 'config/application' | ||
|
||
Rails.application.load_tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module ApplicationCable | ||
class Channel < ActionCable::Channel::Base | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module ApplicationCable | ||
class Connection < ActionCable::Connection::Base | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
class ApplicationController < ActionController::API | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class HealthcheckController < ApplicationController | ||
def index | ||
render json: { status: "ok" }, status: :ok | ||
render json: { status: 'ok' }, status: :ok | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'securerandom' | ||
class MetricsController < ApplicationController | ||
def index | ||
# Get the queue attributes | ||
queue_url = $sqs.get_queue_url(queue_name: "registrations.fifo").queue_url | ||
queue_url = $sqs.get_queue_url(queue_name: 'registrations.fifo').queue_url | ||
response = $sqs.get_queue_attributes({ | ||
queue_url: queue_url, | ||
attribute_names: ["ApproximateNumberOfMessages"] | ||
}) | ||
queue_url: queue_url, | ||
attribute_names: ['ApproximateNumberOfMessages'], | ||
}) | ||
|
||
# Get the queue size | ||
queue_size = response.attributes["ApproximateNumberOfMessages"].to_i | ||
queue_size = response.attributes['ApproximateNumberOfMessages'].to_i | ||
|
||
render json: { queue_size: queue_size} | ||
render json: { queue_size: queue_size } | ||
end | ||
end |
Oops, something went wrong.