Skip to content

Commit

Permalink
Merge branch 'glitch-soc-main'
Browse files Browse the repository at this point in the history
  • Loading branch information
koyuawsmbrtn committed Mar 29, 2023
2 parents 2c5b550 + 0a9b14d commit e51e7cf
Show file tree
Hide file tree
Showing 572 changed files with 7,834 additions and 2,726 deletions.
24 changes: 23 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@ module.exports = {
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true,
},
ecmaVersion: 2021,
requireConfigFile: false,
babelOptions: {
configFile: false,
presets: ['@babel/react', '@babel/env'],
},
},

settings: {
Expand Down Expand Up @@ -214,4 +218,22 @@ module.exports = {
'promise/no-nesting': 'off',
'promise/no-promise-in-callback': 'off',
},

overrides: [
{
files: [
'*.config.js',
'.*rc.js',
'ide-helper.js',
],

env: {
commonjs: true,
},

parserOptions: {
sourceType: 'script',
},
},
],
};
2 changes: 1 addition & 1 deletion .github/workflows/test-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
ruby-version: .ruby-version
bundler-cache: true

- run: yarn install --frozen-lockfile
- run: yarn --frozen-lockfile --production
- name: Precompile assets
# Previously had set this, but it's not supported
# export NODE_OPTIONS=--openssl-legacy-provider
Expand Down
32 changes: 5 additions & 27 deletions .haml-lint_todo.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
# This configuration was generated by
# `haml-lint --auto-gen-config`
# on 2023-02-11 02:16:03 -0500 using Haml-Lint version 0.45.0.
# on 2023-03-15 00:55:01 -0400 using Haml-Lint version 0.45.0.
# The point is for the user to remove these configuration records
# one by one as the lints are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of Haml-Lint, may require this file to be generated again.

linters:
# Offense count: 76
# Offense count: 63
RuboCop:
exclude:
- 'app/views/accounts/_og.html.haml'
- 'app/views/admin/account_actions/new.html.haml'
- 'app/views/admin/account_warnings/_account_warning.html.haml'
- 'app/views/admin/accounts/index.html.haml'
- 'app/views/admin/accounts/show.html.haml'
- 'app/views/admin/action_logs/index.html.haml'
- 'app/views/admin/announcements/edit.html.haml'
- 'app/views/admin/announcements/new.html.haml'
- 'app/views/admin/change_emails/show.html.haml'
- 'app/views/admin/custom_emojis/index.html.haml'
- 'app/views/admin/dashboard/index.html.haml'
- 'app/views/admin/disputes/appeals/_appeal.html.haml'
- 'app/views/admin/domain_blocks/edit.html.haml'
- 'app/views/admin/domain_blocks/new.html.haml'
Expand All @@ -33,40 +28,24 @@ linters:
- 'app/views/admin/settings/appearance/show.html.haml'
- 'app/views/admin/settings/registrations/show.html.haml'
- 'app/views/admin/statuses/show.html.haml'
- 'app/views/application/_card.html.haml'
- 'app/views/application/_sidebar.html.haml'
- 'app/views/auth/registrations/_sessions.html.haml'
- 'app/views/auth/registrations/new.html.haml'
- 'app/views/auth/sessions/new.html.haml'
- 'app/views/disputes/strikes/show.html.haml'
- 'app/views/filters/_filter_fields.html.haml'
- 'app/views/invites/_form.html.haml'
- 'app/views/layouts/application.html.haml'
- 'app/views/layouts/error.html.haml'
- 'app/views/layouts/mailer.html.haml'
- 'app/views/notification_mailer/_status.html.haml'
- 'app/views/notification_mailer/favourite.html.haml'
- 'app/views/notification_mailer/follow_request.html.haml'
- 'app/views/oauth/authorizations/new.html.haml'
- 'app/views/oauth/authorized_applications/index.html.haml'
- 'app/views/settings/applications/_fields.html.haml'
- 'app/views/settings/imports/show.html.haml'
- 'app/views/settings/login_activities/_login_activity.html.haml'
- 'app/views/settings/preferences/appearance/show.html.haml'
- 'app/views/settings/preferences/other/show.html.haml'
- 'app/views/settings/preferences/other/show.html.haml'
- 'app/views/statuses_cleanup/show.html.haml'
- 'app/views/statuses/_detailed_status.html.haml'
- 'app/views/statuses/_og_image.html.haml'
- 'app/views/statuses/_poll.html.haml'
- 'app/views/statuses/_status.html.haml'
- 'app/views/statuses/show.html.haml'
- 'app/views/user_mailer/suspicious_sign_in.html.haml'
- 'app/views/statuses_cleanup/show.html.haml'
- 'app/views/user_mailer/warning.html.haml'
- 'app/views/user_mailer/webauthn_credential_added.html.haml'
- 'app/views/user_mailer/webauthn_credential_deleted.html.haml'

# Offense count: 918
# Offense count: 913
LineLength:
enabled: false

Expand Down Expand Up @@ -97,13 +76,12 @@ linters:
- 'app/views/admin/reports/show.html.haml'
- 'app/views/disputes/strikes/show.html.haml'

# Offense count: 43
# Offense count: 41
InstanceVariables:
exclude:
- 'app/views/admin/reports/_actions.html.haml'
- 'app/views/admin/roles/_form.html.haml'
- 'app/views/admin/webhooks/_form.html.haml'
- 'app/views/application/_sidebar.html.haml'
- 'app/views/auth/registrations/_sessions.html.haml'
- 'app/views/auth/registrations/_status.html.haml'
- 'app/views/auth/sessions/two_factor/_otp_authentication_form.html.haml'
Expand Down
63 changes: 51 additions & 12 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require:
- rubocop-rails
- rubocop-rspec
- rubocop-performance
- rubocop-capybara

AllCops:
TargetRubyVersion: 2.7
Expand All @@ -19,7 +20,6 @@ AllCops:
NewCops: enable
Exclude:
- db/schema.rb
- 'config/**/*'
- 'bin/*'
- 'Rakefile'
- 'node_modules/**/*'
Expand All @@ -32,7 +32,6 @@ Layout/FirstHashElementIndentation:
EnforcedStyle: consistent

Layout/LineLength:
Max: 140 # RuboCop default 120
AllowedPatterns:
# Allow comments to be long lines
- !ruby/regexp / \# .*$/
Expand All @@ -47,13 +46,11 @@ Lint/UselessAccessModifier:
- class_methods

Metrics/AbcSize:
Max: 34 # RuboCop default 17
Exclude:
- 'lib/**/*cli*.rb'
- db/*migrate/**/*

Metrics/BlockLength:
Max: 55 # Default 25
CountAsOne: [array, heredoc]
Exclude:
- 'lib/mastodon/*_cli.rb'
Expand All @@ -62,31 +59,63 @@ Metrics/BlockNesting:
Exclude:
- 'lib/mastodon/*_cli.rb'

# Reason: Some Excluded files would be candidates for refactoring but not currently addressed
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsclasslength
Metrics/ClassLength:
Max: 500 # Default 100
CountAsOne: [array, heredoc]
CountAsOne: ['array', 'hash', 'heredoc', 'method_call']
Exclude:
- 'lib/mastodon/*_cli.rb'
- 'app/controllers/admin/accounts_controller.rb'
- 'app/controllers/api/base_controller.rb'
- 'app/controllers/api/v1/admin/accounts_controller.rb'
- 'app/controllers/application_controller.rb'
- 'app/controllers/auth/registrations_controller.rb'
- 'app/controllers/auth/sessions_controller.rb'
- 'app/lib/activitypub/activity.rb'
- 'app/lib/activitypub/activity/create.rb'
- 'app/lib/activitypub/tag_manager.rb'
- 'app/lib/feed_manager.rb'
- 'app/lib/link_details_extractor.rb'
- 'app/lib/request.rb'
- 'app/lib/text_formatter.rb'
- 'app/lib/user_settings_decorator.rb'
- 'app/mailers/user_mailer.rb'
- 'app/models/account.rb'
- 'app/models/admin/account_action.rb'
- 'app/models/form/account_batch.rb'
- 'app/models/media_attachment.rb'
- 'app/models/status.rb'
- 'app/models/tag.rb'
- 'app/models/user.rb'
- 'app/serializers/activitypub/actor_serializer.rb'
- 'app/serializers/activitypub/note_serializer.rb'
- 'app/serializers/rest/status_serializer.rb'
- 'app/services/account_search_service.rb'
- 'app/services/activitypub/process_account_service.rb'
- 'app/services/activitypub/process_status_update_service.rb'
- 'app/services/backup_service.rb'
- 'app/services/delete_account_service.rb'
- 'app/services/fan_out_on_write_service.rb'
- 'app/services/fetch_link_card_service.rb'
- 'app/services/import_service.rb'
- 'app/services/notify_service.rb'
- 'app/services/post_status_service.rb'
- 'app/services/update_status_service.rb'
- 'lib/paperclip/color_extractor.rb'

Metrics/CyclomaticComplexity:
Max: 12 # Default 7
Exclude:
- lib/mastodon/*cli*.rb
- db/*migrate/**/*

Metrics/MethodLength:
Max: 25 # RuboCop default 10
CountAsOne: [array, heredoc]
Exclude:
- 'lib/mastodon/*_cli.rb'

Metrics/ModuleLength:
Max: 200 # Default 100
CountAsOne: [array, heredoc]

Metrics/PerceivedComplexity:
Max: 16 # RuboCop default 8

Rails/HttpStatus:
EnforcedStyle: numeric

Expand Down Expand Up @@ -123,6 +152,16 @@ RSpec/NotToNot:
RSpec/Rails/HttpStatus:
EnforcedStyle: numeric

# Reason:
# https://docs.rubocop.org/rubocop/cops_style.html#styleclassandmodulechildren
Style/ClassAndModuleChildren:
Enabled: false

# Reason: Classes mostly self-document with their names
# https://docs.rubocop.org/rubocop/cops_style.html#styledocumentation
Style/Documentation:
Enabled: false

Style/HashSyntax:
EnforcedStyle: ruby19_no_mixed_keys

Expand Down
Loading

0 comments on commit e51e7cf

Please sign in to comment.