-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from MITLibraries/tco46-linting
Tco46 linting
- Loading branch information
Showing
61 changed files
with
506 additions
and
194 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
inherit_from: .rubocop_todo.yml | ||
|
||
require: | ||
- rubocop-capybara | ||
- rubocop-graphql | ||
- rubocop-minitest | ||
- rubocop-performance | ||
- rubocop-rails | ||
|
||
AllCops: | ||
TargetRubyVersion: 3.2 | ||
NewCops: enable | ||
Exclude: | ||
- "db/**/*" | ||
- "config/**/*" | ||
- "bin/**" | ||
- 'node_modules/**/*' | ||
- 'tmp/**/*' | ||
- 'vendor/**/*' | ||
- '.git/**/*' | ||
- 'Gemfile' | ||
- 'Rakefile' | ||
- 'config.ru' | ||
|
||
Metrics/BlockLength: | ||
Exclude: | ||
- "test/**/*" | ||
|
||
Metrics/ClassLength: | ||
Exclude: | ||
- "test/**/*" | ||
|
||
Metrics/MethodLength: | ||
Exclude: | ||
- "test/**/*.rb" |
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,126 @@ | ||
# This configuration was generated by | ||
# `rubocop --auto-gen-config` | ||
# on 2024-08-12 20:10:38 UTC using RuboCop version 1.65.0. | ||
# The point is for the user to remove these configuration records | ||
# one by one as the offenses are removed from the code base. | ||
# Note that changes in the inspected code, or installation of new | ||
# versions of RuboCop, may require this file to be generated again. | ||
|
||
# Offense count: 3 | ||
GraphQL/ArgumentDescription: | ||
Exclude: | ||
- 'app/graphql/types/query_type.rb' | ||
|
||
# Offense count: 28 | ||
GraphQL/FieldDescription: | ||
Exclude: | ||
- 'app/graphql/types/details_type.rb' | ||
- 'app/graphql/types/search_event_type.rb' | ||
- 'app/graphql/types/standard_identifiers_type.rb' | ||
- 'app/graphql/types/term_type.rb' | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: Include. | ||
# Include: **/graphql/**/*_schema.rb | ||
GraphQL/MaxComplexitySchema: | ||
Exclude: | ||
- 'app/graphql/tacos_schema.rb' | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: Include. | ||
# Include: **/graphql/**/*_schema.rb | ||
GraphQL/MaxDepthSchema: | ||
Exclude: | ||
- 'app/graphql/tacos_schema.rb' | ||
|
||
# Offense count: 7 | ||
GraphQL/ObjectDescription: | ||
Exclude: | ||
- 'app/graphql/mutations/base_mutation.rb' | ||
- 'app/graphql/tacos_schema.rb' | ||
- 'app/graphql/types/base_argument.rb' | ||
- 'app/graphql/types/base_connection.rb' | ||
- 'app/graphql/types/base_edge.rb' | ||
- 'app/graphql/types/base_enum.rb' | ||
- 'app/graphql/types/base_field.rb' | ||
- 'app/graphql/types/base_input_object.rb' | ||
- 'app/graphql/types/base_interface.rb' | ||
- 'app/graphql/types/base_object.rb' | ||
- 'app/graphql/types/base_scalar.rb' | ||
- 'app/graphql/types/base_union.rb' | ||
- 'app/graphql/types/details_type.rb' | ||
- 'app/graphql/types/mutation_type.rb' | ||
- 'app/graphql/types/node_type.rb' | ||
- 'app/graphql/types/query_type.rb' | ||
- 'app/graphql/types/search_event_type.rb' | ||
- 'app/graphql/types/standard_identifiers_type.rb' | ||
- 'app/graphql/types/term_type.rb' | ||
|
||
# Offense count: 1 | ||
Lint/DuplicateMethods: | ||
Exclude: | ||
- 'app/graphql/types/query_type.rb' | ||
|
||
# Offense count: 1 | ||
# This cop supports unsafe autocorrection (--autocorrect-all). | ||
# Configuration parameters: AutoCorrect. | ||
Lint/UselessMethodDefinition: | ||
Exclude: | ||
- 'app/graphql/tacos_schema.rb' | ||
|
||
# Offense count: 1 | ||
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. | ||
Metrics/AbcSize: | ||
Max: 18 | ||
|
||
# Offense count: 2 | ||
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. | ||
# AllowedMethods: refine | ||
Metrics/BlockLength: | ||
Max: 60 | ||
|
||
# Offense count: 4 | ||
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. | ||
Metrics/MethodLength: | ||
Max: 16 | ||
|
||
# Offense count: 1 | ||
Minitest/AssertRaisesCompoundBody: | ||
Exclude: | ||
- 'test/tasks/suggested_resource_rake_test.rb' | ||
|
||
# Offense count: 2 | ||
Minitest/MultipleAssertions: | ||
Max: 5 | ||
|
||
# Offense count: 6 | ||
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. | ||
# SupportedStyles: snake_case, normalcase, non_integer | ||
# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 | ||
Naming/VariableNumber: | ||
Exclude: | ||
- 'test/models/metrics/algorithms_test.rb' | ||
|
||
# Offense count: 1 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
Performance/StringReplacement: | ||
Exclude: | ||
- 'lib/tasks/suggested_resources.rake' | ||
|
||
# Offense count: 3 | ||
Rails/I18nLocaleTexts: | ||
Exclude: | ||
- 'app/controllers/admin/application_controller.rb' | ||
- 'app/controllers/application_controller.rb' | ||
|
||
# Offense count: 25 | ||
# Configuration parameters: AllowedConstants. | ||
Style/Documentation: | ||
Enabled: false | ||
|
||
# Offense count: 6 | ||
# This cop supports safe autocorrection (--autocorrect). | ||
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. | ||
# URISchemes: http, https | ||
Layout/LineLength: | ||
Max: 310 |
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,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
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
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,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class StaticController < ApplicationController | ||
def index; 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,21 +1,25 @@ | ||
# frozen_string_literal: true | ||
|
||
# Handles authentication response from Omniauth. See | ||
# [the Devise docs](https://www.rubydoc.info/gems/devise_token_auth/DeviseTokenAuth/OmniauthCallbacksController) for | ||
# additional information about this controller. | ||
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController | ||
include FakeAuthConfig | ||
module Users | ||
class OmniauthCallbacksController < Devise::OmniauthCallbacksController | ||
include FakeAuthConfig | ||
|
||
def openid_connect | ||
@user = User.from_omniauth(request.env['omniauth.auth']) | ||
sign_in_and_redirect @user, event: :authentication | ||
flash[:notice] = "Welcome, #{@user.email}!" | ||
end | ||
def openid_connect | ||
@user = User.from_omniauth(request.env['omniauth.auth']) | ||
sign_in_and_redirect @user, event: :authentication | ||
flash[:notice] = "Welcome, #{@user.email}!" | ||
end | ||
|
||
# Developer authentication is used in local dev and PR builds. | ||
def developer | ||
raise 'Invalid Authentication' unless FakeAuthConfig.fake_auth_enabled? | ||
# Developer authentication is used in local dev and PR builds. | ||
def developer | ||
raise 'Invalid Authentication' unless FakeAuthConfig.fake_auth_enabled? | ||
|
||
@user = User.from_omniauth(request.env['omniauth.auth']) | ||
sign_in_and_redirect @user, event: :authentication | ||
flash[:notice] = "Welcome, #{@user.email}!" | ||
@user = User.from_omniauth(request.env['omniauth.auth']) | ||
sign_in_and_redirect @user, event: :authentication | ||
flash[:notice] = "Welcome, #{@user.email}!" | ||
end | ||
end | ||
end |
Oops, something went wrong.