2023-02-16 06:33:50 +00:00
|
|
|
inherit_from: .rubocop_todo.yml
|
|
|
|
|
|
|
|
inherit_mode:
|
|
|
|
merge:
|
|
|
|
- Exclude
|
|
|
|
|
2019-06-06 11:31:48 +01:00
|
|
|
require:
|
|
|
|
- rubocop-rails
|
linting: RuboCop update, config fixes (#20574)
* fix(rubocop): update gems and add performance and rspec
fix(rubocop): update gems and add performance and rspec
- update present rubocop gems
- add rubocop-rspec and rubocop-performance gems
- move rubocop gems to gem group :development, :test in order to
make linting in a github action that runs with RAILS_ENV=test possible
* feat(rubocop): disable some annoyance RSpec cops
To mee these prooved to be more annoying than helpful.
If not agreed, they can be enabled any time.
* fix(rubocop): do not ignore spec/**/*
Because rubocop-rspec should lint the specs as well, and they
deserve to be readable in general. It is relevant code, after all.
* fix(rubocop): change ignore db/**/* to db/schema.rb
because rails cops do some lints for migrations.
E.g. reversable migrations linting and more.
* fix(rubocop): tune rules configs
Bunch of commits squashed:
fix(rubocop): enable Layout/LineLength cop
Because this project has code with line lenghts > 500 chars.
This is not good practice at all, so I strongly suggest to
change the practice in the future.
But allow heredoc, URI and comments to still be long lines
and make the default Max: 120 explicit, by repeating it in the
config. To me this max length seems reasonable. Perhaps
a bit more could be ok for some. But > 500 chars in one line
Seems to be way too long IMHO.
fix(rubocop): Metrics/CyclomaticComplexity Max to 12
The default is 7, perhaps quite strict. But 25 is too loose,
the rule becomes pointless like that.
fix(rubocop): AllCops ruby version, cacheing and more info
- fix the target ruby version from 2.5 to 3.0
- have the cop error messages to be more informative and helpful
- enable cacheing in /tmp
fix(rubocop): Metrics/AbcSize to 34 from 115
Rubocops default is 17. If the rule is at 115 is becomes
pointless.
fix(rubocop): Metrics/BlockLength improvements
- instead of ignoring tasks completely, ignore only the
long blocks that are specific to tasks (task, namespace)
- ignore also concern specific block methods (included, class_methods)
fix(rubocop): Metrics/ClassLength count heredoc array as one line
fix(rubocop): Metrics/MethodLength Max to 25
- the default is 10, but 65 is too loose, so perhaps 25?
fix(rubocop): Metrics/ModuleLength array and heredoc count as one
fix(rubocop): Metrics/PerceivedComplexity to 16 from 25
Rubocops default is 8, so how about only doubling that, instead
of > than tripple it?
fix(rubocop): enable Style/RedundantAssignment
Because I think that this rule would never really hurt,
but improve code quality and readability.
fix(rubocop): enable Style/RescueStandardError
I think everyone that ever had to debug what this can bring
will hopefully agree that this rule totally makes sense.
In the super rare exeptions where this is totally needed,
it can be excluded by disabling comment in that place.
fix(rubocop): Metrics/ParameterLists add explicit defaults and some excludes
2022-12-15 15:39:59 +00:00
|
|
|
- rubocop-rspec
|
|
|
|
- rubocop-performance
|
2023-03-17 09:13:28 +00:00
|
|
|
- rubocop-capybara
|
2019-06-06 11:31:48 +01:00
|
|
|
|
2017-06-01 16:24:30 +01:00
|
|
|
AllCops:
|
2022-11-27 19:41:39 +00:00
|
|
|
TargetRubyVersion: 2.7
|
linting: RuboCop update, config fixes (#20574)
* fix(rubocop): update gems and add performance and rspec
fix(rubocop): update gems and add performance and rspec
- update present rubocop gems
- add rubocop-rspec and rubocop-performance gems
- move rubocop gems to gem group :development, :test in order to
make linting in a github action that runs with RAILS_ENV=test possible
* feat(rubocop): disable some annoyance RSpec cops
To mee these prooved to be more annoying than helpful.
If not agreed, they can be enabled any time.
* fix(rubocop): do not ignore spec/**/*
Because rubocop-rspec should lint the specs as well, and they
deserve to be readable in general. It is relevant code, after all.
* fix(rubocop): change ignore db/**/* to db/schema.rb
because rails cops do some lints for migrations.
E.g. reversable migrations linting and more.
* fix(rubocop): tune rules configs
Bunch of commits squashed:
fix(rubocop): enable Layout/LineLength cop
Because this project has code with line lenghts > 500 chars.
This is not good practice at all, so I strongly suggest to
change the practice in the future.
But allow heredoc, URI and comments to still be long lines
and make the default Max: 120 explicit, by repeating it in the
config. To me this max length seems reasonable. Perhaps
a bit more could be ok for some. But > 500 chars in one line
Seems to be way too long IMHO.
fix(rubocop): Metrics/CyclomaticComplexity Max to 12
The default is 7, perhaps quite strict. But 25 is too loose,
the rule becomes pointless like that.
fix(rubocop): AllCops ruby version, cacheing and more info
- fix the target ruby version from 2.5 to 3.0
- have the cop error messages to be more informative and helpful
- enable cacheing in /tmp
fix(rubocop): Metrics/AbcSize to 34 from 115
Rubocops default is 17. If the rule is at 115 is becomes
pointless.
fix(rubocop): Metrics/BlockLength improvements
- instead of ignoring tasks completely, ignore only the
long blocks that are specific to tasks (task, namespace)
- ignore also concern specific block methods (included, class_methods)
fix(rubocop): Metrics/ClassLength count heredoc array as one line
fix(rubocop): Metrics/MethodLength Max to 25
- the default is 10, but 65 is too loose, so perhaps 25?
fix(rubocop): Metrics/ModuleLength array and heredoc count as one
fix(rubocop): Metrics/PerceivedComplexity to 16 from 25
Rubocops default is 8, so how about only doubling that, instead
of > than tripple it?
fix(rubocop): enable Style/RedundantAssignment
Because I think that this rule would never really hurt,
but improve code quality and readability.
fix(rubocop): enable Style/RescueStandardError
I think everyone that ever had to debug what this can bring
will hopefully agree that this rule totally makes sense.
In the super rare exeptions where this is totally needed,
it can be excluded by disabling comment in that place.
fix(rubocop): Metrics/ParameterLists add explicit defaults and some excludes
2022-12-15 15:39:59 +00:00
|
|
|
DisplayCopNames: true
|
|
|
|
DisplayStyleGuide: true
|
|
|
|
ExtraDetails: true
|
|
|
|
UseCache: true
|
|
|
|
CacheRootDirectory: tmp
|
|
|
|
NewCops: enable
|
2017-06-01 16:24:30 +01:00
|
|
|
Exclude:
|
linting: RuboCop update, config fixes (#20574)
* fix(rubocop): update gems and add performance and rspec
fix(rubocop): update gems and add performance and rspec
- update present rubocop gems
- add rubocop-rspec and rubocop-performance gems
- move rubocop gems to gem group :development, :test in order to
make linting in a github action that runs with RAILS_ENV=test possible
* feat(rubocop): disable some annoyance RSpec cops
To mee these prooved to be more annoying than helpful.
If not agreed, they can be enabled any time.
* fix(rubocop): do not ignore spec/**/*
Because rubocop-rspec should lint the specs as well, and they
deserve to be readable in general. It is relevant code, after all.
* fix(rubocop): change ignore db/**/* to db/schema.rb
because rails cops do some lints for migrations.
E.g. reversable migrations linting and more.
* fix(rubocop): tune rules configs
Bunch of commits squashed:
fix(rubocop): enable Layout/LineLength cop
Because this project has code with line lenghts > 500 chars.
This is not good practice at all, so I strongly suggest to
change the practice in the future.
But allow heredoc, URI and comments to still be long lines
and make the default Max: 120 explicit, by repeating it in the
config. To me this max length seems reasonable. Perhaps
a bit more could be ok for some. But > 500 chars in one line
Seems to be way too long IMHO.
fix(rubocop): Metrics/CyclomaticComplexity Max to 12
The default is 7, perhaps quite strict. But 25 is too loose,
the rule becomes pointless like that.
fix(rubocop): AllCops ruby version, cacheing and more info
- fix the target ruby version from 2.5 to 3.0
- have the cop error messages to be more informative and helpful
- enable cacheing in /tmp
fix(rubocop): Metrics/AbcSize to 34 from 115
Rubocops default is 17. If the rule is at 115 is becomes
pointless.
fix(rubocop): Metrics/BlockLength improvements
- instead of ignoring tasks completely, ignore only the
long blocks that are specific to tasks (task, namespace)
- ignore also concern specific block methods (included, class_methods)
fix(rubocop): Metrics/ClassLength count heredoc array as one line
fix(rubocop): Metrics/MethodLength Max to 25
- the default is 10, but 65 is too loose, so perhaps 25?
fix(rubocop): Metrics/ModuleLength array and heredoc count as one
fix(rubocop): Metrics/PerceivedComplexity to 16 from 25
Rubocops default is 8, so how about only doubling that, instead
of > than tripple it?
fix(rubocop): enable Style/RedundantAssignment
Because I think that this rule would never really hurt,
but improve code quality and readability.
fix(rubocop): enable Style/RescueStandardError
I think everyone that ever had to debug what this can bring
will hopefully agree that this rule totally makes sense.
In the super rare exeptions where this is totally needed,
it can be excluded by disabling comment in that place.
fix(rubocop): Metrics/ParameterLists add explicit defaults and some excludes
2022-12-15 15:39:59 +00:00
|
|
|
- db/schema.rb
|
2022-03-21 03:46:11 +00:00
|
|
|
- 'bin/*'
|
|
|
|
- 'Rakefile'
|
|
|
|
- 'node_modules/**/*'
|
|
|
|
- 'Vagrantfile'
|
|
|
|
- 'vendor/**/*'
|
|
|
|
- 'lib/json_ld/*'
|
|
|
|
- 'lib/templates/**/*'
|
2016-09-29 20:28:21 +01:00
|
|
|
|
2022-02-24 23:34:14 +00:00
|
|
|
Layout/FirstHashElementIndentation:
|
|
|
|
EnforcedStyle: consistent
|
|
|
|
|
2023-02-16 06:33:50 +00:00
|
|
|
Layout/LineLength:
|
|
|
|
AllowedPatterns:
|
|
|
|
# Allow comments to be long lines
|
|
|
|
- !ruby/regexp / \# .*$/
|
|
|
|
- !ruby/regexp /^\# .*$/
|
|
|
|
Exclude:
|
|
|
|
- lib/**/*cli*.rb
|
|
|
|
- db/*migrate/**/*
|
|
|
|
- db/seeds/**/*
|
2020-09-01 02:04:00 +01:00
|
|
|
|
2020-07-14 18:05:07 +01:00
|
|
|
Lint/UselessAccessModifier:
|
|
|
|
ContextCreatingMethods:
|
|
|
|
- class_methods
|
|
|
|
|
2016-11-15 15:56:29 +00:00
|
|
|
Metrics/AbcSize:
|
2020-09-01 02:04:00 +01:00
|
|
|
Exclude:
|
linting: RuboCop update, config fixes (#20574)
* fix(rubocop): update gems and add performance and rspec
fix(rubocop): update gems and add performance and rspec
- update present rubocop gems
- add rubocop-rspec and rubocop-performance gems
- move rubocop gems to gem group :development, :test in order to
make linting in a github action that runs with RAILS_ENV=test possible
* feat(rubocop): disable some annoyance RSpec cops
To mee these prooved to be more annoying than helpful.
If not agreed, they can be enabled any time.
* fix(rubocop): do not ignore spec/**/*
Because rubocop-rspec should lint the specs as well, and they
deserve to be readable in general. It is relevant code, after all.
* fix(rubocop): change ignore db/**/* to db/schema.rb
because rails cops do some lints for migrations.
E.g. reversable migrations linting and more.
* fix(rubocop): tune rules configs
Bunch of commits squashed:
fix(rubocop): enable Layout/LineLength cop
Because this project has code with line lenghts > 500 chars.
This is not good practice at all, so I strongly suggest to
change the practice in the future.
But allow heredoc, URI and comments to still be long lines
and make the default Max: 120 explicit, by repeating it in the
config. To me this max length seems reasonable. Perhaps
a bit more could be ok for some. But > 500 chars in one line
Seems to be way too long IMHO.
fix(rubocop): Metrics/CyclomaticComplexity Max to 12
The default is 7, perhaps quite strict. But 25 is too loose,
the rule becomes pointless like that.
fix(rubocop): AllCops ruby version, cacheing and more info
- fix the target ruby version from 2.5 to 3.0
- have the cop error messages to be more informative and helpful
- enable cacheing in /tmp
fix(rubocop): Metrics/AbcSize to 34 from 115
Rubocops default is 17. If the rule is at 115 is becomes
pointless.
fix(rubocop): Metrics/BlockLength improvements
- instead of ignoring tasks completely, ignore only the
long blocks that are specific to tasks (task, namespace)
- ignore also concern specific block methods (included, class_methods)
fix(rubocop): Metrics/ClassLength count heredoc array as one line
fix(rubocop): Metrics/MethodLength Max to 25
- the default is 10, but 65 is too loose, so perhaps 25?
fix(rubocop): Metrics/ModuleLength array and heredoc count as one
fix(rubocop): Metrics/PerceivedComplexity to 16 from 25
Rubocops default is 8, so how about only doubling that, instead
of > than tripple it?
fix(rubocop): enable Style/RedundantAssignment
Because I think that this rule would never really hurt,
but improve code quality and readability.
fix(rubocop): enable Style/RescueStandardError
I think everyone that ever had to debug what this can bring
will hopefully agree that this rule totally makes sense.
In the super rare exeptions where this is totally needed,
it can be excluded by disabling comment in that place.
fix(rubocop): Metrics/ParameterLists add explicit defaults and some excludes
2022-12-15 15:39:59 +00:00
|
|
|
- 'lib/**/*cli*.rb'
|
|
|
|
- db/*migrate/**/*
|
2016-10-22 18:38:47 +01:00
|
|
|
|
2023-03-31 08:33:25 +01:00
|
|
|
# Reason: Some functions cannot be broken up, but others may be refactor candidates
|
|
|
|
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsblocklength
|
2017-06-08 12:24:28 +01:00
|
|
|
Metrics/BlockLength:
|
2023-03-31 08:33:25 +01:00
|
|
|
CountAsOne: ['array', 'hash', 'heredoc', 'method_call']
|
2017-06-08 12:24:28 +01:00
|
|
|
Exclude:
|
2020-09-01 02:04:00 +01:00
|
|
|
- 'lib/mastodon/*_cli.rb'
|
2023-03-31 08:33:25 +01:00
|
|
|
- 'lib/tasks/*.rake'
|
|
|
|
- 'app/models/concerns/account_associations.rb'
|
|
|
|
- 'app/models/concerns/account_interactions.rb'
|
|
|
|
- 'app/models/concerns/ldap_authenticable.rb'
|
|
|
|
- 'app/models/concerns/omniauthable.rb'
|
|
|
|
- 'app/models/concerns/pam_authenticable.rb'
|
|
|
|
- 'app/models/concerns/remotable.rb'
|
|
|
|
- 'app/services/suspend_account_service.rb'
|
|
|
|
- 'app/services/unsuspend_account_service.rb'
|
|
|
|
- 'app/views/accounts/show.rss.ruby'
|
|
|
|
- 'app/views/tags/show.rss.ruby'
|
|
|
|
- 'config/environments/development.rb'
|
|
|
|
- 'config/environments/production.rb'
|
|
|
|
- 'config/initializers/devise.rb'
|
|
|
|
- 'config/initializers/doorkeeper.rb'
|
|
|
|
- 'config/initializers/omniauth.rb'
|
|
|
|
- 'config/initializers/simple_form.rb'
|
|
|
|
- 'config/navigation.rb'
|
|
|
|
- 'config/routes.rb'
|
|
|
|
- 'db/post_migrate/20221101190723_backfill_admin_action_logs.rb'
|
|
|
|
- 'db/post_migrate/20221206114142_backfill_admin_action_logs_again.rb'
|
|
|
|
- 'lib/paperclip/gif_transcoder.rb'
|
2017-06-08 12:24:28 +01:00
|
|
|
|
2016-11-15 15:56:29 +00:00
|
|
|
Metrics/BlockNesting:
|
2020-09-01 02:04:00 +01:00
|
|
|
Exclude:
|
|
|
|
- 'lib/mastodon/*_cli.rb'
|
2016-11-15 15:56:29 +00:00
|
|
|
|
2023-03-23 22:19:41 +00:00
|
|
|
# Reason: Some Excluded files would be candidates for refactoring but not currently addressed
|
|
|
|
# https://docs.rubocop.org/rubocop/cops_metrics.html#metricsclasslength
|
2016-11-15 15:56:29 +00:00
|
|
|
Metrics/ClassLength:
|
2023-03-23 22:19:41 +00:00
|
|
|
CountAsOne: ['array', 'hash', 'heredoc', 'method_call']
|
2020-09-01 02:04:00 +01:00
|
|
|
Exclude:
|
|
|
|
- 'lib/mastodon/*_cli.rb'
|
2023-03-23 22:19:41 +00:00
|
|
|
- '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'
|
2016-11-15 15:56:29 +00:00
|
|
|
|
|
|
|
Metrics/CyclomaticComplexity:
|
2020-09-01 02:04:00 +01:00
|
|
|
Exclude:
|
linting: RuboCop update, config fixes (#20574)
* fix(rubocop): update gems and add performance and rspec
fix(rubocop): update gems and add performance and rspec
- update present rubocop gems
- add rubocop-rspec and rubocop-performance gems
- move rubocop gems to gem group :development, :test in order to
make linting in a github action that runs with RAILS_ENV=test possible
* feat(rubocop): disable some annoyance RSpec cops
To mee these prooved to be more annoying than helpful.
If not agreed, they can be enabled any time.
* fix(rubocop): do not ignore spec/**/*
Because rubocop-rspec should lint the specs as well, and they
deserve to be readable in general. It is relevant code, after all.
* fix(rubocop): change ignore db/**/* to db/schema.rb
because rails cops do some lints for migrations.
E.g. reversable migrations linting and more.
* fix(rubocop): tune rules configs
Bunch of commits squashed:
fix(rubocop): enable Layout/LineLength cop
Because this project has code with line lenghts > 500 chars.
This is not good practice at all, so I strongly suggest to
change the practice in the future.
But allow heredoc, URI and comments to still be long lines
and make the default Max: 120 explicit, by repeating it in the
config. To me this max length seems reasonable. Perhaps
a bit more could be ok for some. But > 500 chars in one line
Seems to be way too long IMHO.
fix(rubocop): Metrics/CyclomaticComplexity Max to 12
The default is 7, perhaps quite strict. But 25 is too loose,
the rule becomes pointless like that.
fix(rubocop): AllCops ruby version, cacheing and more info
- fix the target ruby version from 2.5 to 3.0
- have the cop error messages to be more informative and helpful
- enable cacheing in /tmp
fix(rubocop): Metrics/AbcSize to 34 from 115
Rubocops default is 17. If the rule is at 115 is becomes
pointless.
fix(rubocop): Metrics/BlockLength improvements
- instead of ignoring tasks completely, ignore only the
long blocks that are specific to tasks (task, namespace)
- ignore also concern specific block methods (included, class_methods)
fix(rubocop): Metrics/ClassLength count heredoc array as one line
fix(rubocop): Metrics/MethodLength Max to 25
- the default is 10, but 65 is too loose, so perhaps 25?
fix(rubocop): Metrics/ModuleLength array and heredoc count as one
fix(rubocop): Metrics/PerceivedComplexity to 16 from 25
Rubocops default is 8, so how about only doubling that, instead
of > than tripple it?
fix(rubocop): enable Style/RedundantAssignment
Because I think that this rule would never really hurt,
but improve code quality and readability.
fix(rubocop): enable Style/RescueStandardError
I think everyone that ever had to debug what this can bring
will hopefully agree that this rule totally makes sense.
In the super rare exeptions where this is totally needed,
it can be excluded by disabling comment in that place.
fix(rubocop): Metrics/ParameterLists add explicit defaults and some excludes
2022-12-15 15:39:59 +00:00
|
|
|
- lib/mastodon/*cli*.rb
|
|
|
|
- db/*migrate/**/*
|
2017-06-01 16:24:30 +01:00
|
|
|
|
2016-11-15 15:56:29 +00:00
|
|
|
Metrics/MethodLength:
|
2023-02-16 06:33:50 +00:00
|
|
|
CountAsOne: [array, heredoc]
|
2020-09-01 02:04:00 +01:00
|
|
|
Exclude:
|
|
|
|
- 'lib/mastodon/*_cli.rb'
|
2016-11-15 15:56:29 +00:00
|
|
|
|
|
|
|
Metrics/ModuleLength:
|
linting: RuboCop update, config fixes (#20574)
* fix(rubocop): update gems and add performance and rspec
fix(rubocop): update gems and add performance and rspec
- update present rubocop gems
- add rubocop-rspec and rubocop-performance gems
- move rubocop gems to gem group :development, :test in order to
make linting in a github action that runs with RAILS_ENV=test possible
* feat(rubocop): disable some annoyance RSpec cops
To mee these prooved to be more annoying than helpful.
If not agreed, they can be enabled any time.
* fix(rubocop): do not ignore spec/**/*
Because rubocop-rspec should lint the specs as well, and they
deserve to be readable in general. It is relevant code, after all.
* fix(rubocop): change ignore db/**/* to db/schema.rb
because rails cops do some lints for migrations.
E.g. reversable migrations linting and more.
* fix(rubocop): tune rules configs
Bunch of commits squashed:
fix(rubocop): enable Layout/LineLength cop
Because this project has code with line lenghts > 500 chars.
This is not good practice at all, so I strongly suggest to
change the practice in the future.
But allow heredoc, URI and comments to still be long lines
and make the default Max: 120 explicit, by repeating it in the
config. To me this max length seems reasonable. Perhaps
a bit more could be ok for some. But > 500 chars in one line
Seems to be way too long IMHO.
fix(rubocop): Metrics/CyclomaticComplexity Max to 12
The default is 7, perhaps quite strict. But 25 is too loose,
the rule becomes pointless like that.
fix(rubocop): AllCops ruby version, cacheing and more info
- fix the target ruby version from 2.5 to 3.0
- have the cop error messages to be more informative and helpful
- enable cacheing in /tmp
fix(rubocop): Metrics/AbcSize to 34 from 115
Rubocops default is 17. If the rule is at 115 is becomes
pointless.
fix(rubocop): Metrics/BlockLength improvements
- instead of ignoring tasks completely, ignore only the
long blocks that are specific to tasks (task, namespace)
- ignore also concern specific block methods (included, class_methods)
fix(rubocop): Metrics/ClassLength count heredoc array as one line
fix(rubocop): Metrics/MethodLength Max to 25
- the default is 10, but 65 is too loose, so perhaps 25?
fix(rubocop): Metrics/ModuleLength array and heredoc count as one
fix(rubocop): Metrics/PerceivedComplexity to 16 from 25
Rubocops default is 8, so how about only doubling that, instead
of > than tripple it?
fix(rubocop): enable Style/RedundantAssignment
Because I think that this rule would never really hurt,
but improve code quality and readability.
fix(rubocop): enable Style/RescueStandardError
I think everyone that ever had to debug what this can bring
will hopefully agree that this rule totally makes sense.
In the super rare exeptions where this is totally needed,
it can be excluded by disabling comment in that place.
fix(rubocop): Metrics/ParameterLists add explicit defaults and some excludes
2022-12-15 15:39:59 +00:00
|
|
|
CountAsOne: [array, heredoc]
|
2016-11-15 15:56:29 +00:00
|
|
|
|
2023-02-20 02:16:40 +00:00
|
|
|
Rails/HttpStatus:
|
|
|
|
EnforcedStyle: numeric
|
|
|
|
|
2018-09-14 16:42:22 +01:00
|
|
|
Rails/Exit:
|
|
|
|
Exclude:
|
2023-02-16 06:33:50 +00:00
|
|
|
- 'lib/mastodon/*_cli.rb'
|
|
|
|
- 'lib/mastodon/cli_helper.rb'
|
2019-03-28 16:56:25 +00:00
|
|
|
- 'lib/cli.rb'
|
2018-09-14 16:42:22 +01:00
|
|
|
|
2023-03-10 15:32:37 +00:00
|
|
|
# Reason: Some single letter camel case files shouldn't be split
|
|
|
|
# https://docs.rubocop.org/rubocop-rspec/cops_rspec.html#rspecfilepath
|
2023-03-03 20:06:31 +00:00
|
|
|
RSpec/FilePath:
|
|
|
|
CustomTransform:
|
2023-03-10 15:32:37 +00:00
|
|
|
ActivityPub: activitypub # Ignore the snake_case due to the amount of files to rename
|
2023-03-03 20:06:31 +00:00
|
|
|
DeepL: deepl
|
2023-03-10 15:32:37 +00:00
|
|
|
FetchOEmbedService: fetch_oembed_service
|
|
|
|
JsonLdHelper: jsonld_helper
|
|
|
|
OEmbedController: oembed_controller
|
|
|
|
OStatus: ostatus
|
|
|
|
NodeInfoController: nodeinfo_controller # NodeInfo isn't snake_cased for any of the instances
|
|
|
|
Exclude:
|
|
|
|
- 'spec/config/initializers/rack_attack_spec.rb' # namespaces usually have separate folder
|
|
|
|
- 'spec/lib/sanitize_config_spec.rb' # namespaces usually have separate folder
|
|
|
|
- 'spec/controllers/concerns/account_controller_concern_spec.rb' # Concerns describe ApplicationController and don't fit naming
|
|
|
|
- 'spec/controllers/concerns/export_controller_concern_spec.rb'
|
|
|
|
- 'spec/controllers/concerns/localized_spec.rb'
|
|
|
|
- 'spec/controllers/concerns/rate_limit_headers_spec.rb'
|
|
|
|
- 'spec/controllers/concerns/signature_verification_spec.rb'
|
|
|
|
- 'spec/controllers/concerns/user_tracking_concern_spec.rb'
|
2023-03-03 20:06:31 +00:00
|
|
|
|
2023-02-20 01:33:27 +00:00
|
|
|
RSpec/NotToNot:
|
|
|
|
EnforcedStyle: to_not
|
|
|
|
|
2023-02-20 02:16:40 +00:00
|
|
|
RSpec/Rails/HttpStatus:
|
|
|
|
EnforcedStyle: numeric
|
|
|
|
|
2023-03-16 21:24:01 +00:00
|
|
|
# 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
|
|
|
|
|
2022-11-17 10:05:39 +00:00
|
|
|
Style/HashSyntax:
|
|
|
|
EnforcedStyle: ruby19_no_mixed_keys
|
|
|
|
|
2023-02-18 02:05:57 +00:00
|
|
|
Style/NumericLiterals:
|
|
|
|
AllowedPatterns:
|
|
|
|
- \d{4}_\d{2}_\d{2}_\d{6} # For DB migration date version number readability
|
|
|
|
|
2017-06-08 12:24:28 +01:00
|
|
|
Style/PercentLiteralDelimiters:
|
|
|
|
PreferredDelimiters:
|
|
|
|
'%i': '()'
|
|
|
|
'%w': '()'
|
|
|
|
|
2023-02-20 10:01:20 +00:00
|
|
|
Style/RescueStandardError:
|
|
|
|
EnforcedStyle: implicit
|
|
|
|
|
2018-06-04 13:49:10 +01:00
|
|
|
Style/TrailingCommaInArrayLiteral:
|
|
|
|
EnforcedStyleForMultiline: 'comma'
|
|
|
|
|
|
|
|
Style/TrailingCommaInHashLiteral:
|
2017-06-01 16:24:30 +01:00
|
|
|
EnforcedStyleForMultiline: 'comma'
|
2023-03-03 21:55:43 +00:00
|
|
|
|
|
|
|
Style/SymbolArray:
|
|
|
|
Enabled: false
|
2023-03-30 13:44:00 +01:00
|
|
|
|
|
|
|
# Reason: Prefer less intendation in conditional assignments
|
|
|
|
# https://docs.rubocop.org/rubocop/cops_style.html#styleredundantbegin
|
|
|
|
Style/RedundantBegin:
|
|
|
|
Enabled: false
|
|
|
|
|
|
|
|
RSpec/NamedSubject:
|
|
|
|
EnforcedStyle: named_only
|