2023-02-16 07:33:50 +01:00
|
|
|
inherit_from: .rubocop_todo.yml
|
|
|
|
|
|
|
|
inherit_mode:
|
|
|
|
merge:
|
|
|
|
- Exclude
|
|
|
|
|
2019-06-06 12:31:48 +02: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 16:39:59 +01:00
|
|
|
- rubocop-rspec
|
|
|
|
- rubocop-performance
|
2019-06-06 12:31:48 +02:00
|
|
|
|
2017-06-01 17:24:30 +02:00
|
|
|
AllCops:
|
2022-11-27 20:41:39 +01: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 16:39:59 +01:00
|
|
|
DisplayCopNames: true
|
|
|
|
DisplayStyleGuide: true
|
|
|
|
ExtraDetails: true
|
|
|
|
UseCache: true
|
|
|
|
CacheRootDirectory: tmp
|
|
|
|
NewCops: enable
|
2017-06-01 17:24:30 +02: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 16:39:59 +01:00
|
|
|
- db/schema.rb
|
2022-03-21 04:46:11 +01:00
|
|
|
- 'config/**/*'
|
|
|
|
- 'bin/*'
|
|
|
|
- 'Rakefile'
|
|
|
|
- 'node_modules/**/*'
|
|
|
|
- 'Vagrantfile'
|
|
|
|
- 'vendor/**/*'
|
|
|
|
- 'lib/json_ld/*'
|
|
|
|
- 'lib/templates/**/*'
|
2016-09-29 21:28:21 +02:00
|
|
|
|
2022-02-25 00:34:14 +01:00
|
|
|
Layout/FirstHashElementIndentation:
|
|
|
|
EnforcedStyle: consistent
|
|
|
|
|
2023-02-16 07:33:50 +01:00
|
|
|
Layout/LineLength:
|
|
|
|
Max: 140 # RuboCop default 120
|
|
|
|
AllowedPatterns:
|
|
|
|
# Allow comments to be long lines
|
|
|
|
- !ruby/regexp / \# .*$/
|
|
|
|
- !ruby/regexp /^\# .*$/
|
|
|
|
Exclude:
|
|
|
|
- lib/**/*cli*.rb
|
|
|
|
- db/*migrate/**/*
|
|
|
|
- db/seeds/**/*
|
2020-09-01 03:04:00 +02:00
|
|
|
|
2020-07-14 19:05:07 +02:00
|
|
|
Lint/UselessAccessModifier:
|
|
|
|
ContextCreatingMethods:
|
|
|
|
- class_methods
|
|
|
|
|
2016-11-15 16:56:29 +01:00
|
|
|
Metrics/AbcSize:
|
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 16:39:59 +01:00
|
|
|
Max: 34 # RuboCop default 17
|
2020-09-01 03:04:00 +02: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 16:39:59 +01:00
|
|
|
- 'lib/**/*cli*.rb'
|
|
|
|
- db/*migrate/**/*
|
2016-10-22 19:38:47 +02:00
|
|
|
|
2017-06-08 13:24:28 +02:00
|
|
|
Metrics/BlockLength:
|
2023-02-16 07:33:50 +01:00
|
|
|
Max: 55 # Default 25
|
|
|
|
CountAsOne: [array, heredoc]
|
2017-06-08 13:24:28 +02:00
|
|
|
Exclude:
|
2020-09-01 03:04:00 +02:00
|
|
|
- 'lib/mastodon/*_cli.rb'
|
2017-06-08 13:24:28 +02:00
|
|
|
|
2016-11-15 16:56:29 +01:00
|
|
|
Metrics/BlockNesting:
|
2020-09-01 03:04:00 +02:00
|
|
|
Exclude:
|
|
|
|
- 'lib/mastodon/*_cli.rb'
|
2016-11-15 16:56:29 +01:00
|
|
|
|
|
|
|
Metrics/ClassLength:
|
2023-02-16 07:33:50 +01:00
|
|
|
Max: 500 # Default 100
|
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 16:39:59 +01:00
|
|
|
CountAsOne: [array, heredoc]
|
2020-09-01 03:04:00 +02:00
|
|
|
Exclude:
|
|
|
|
- 'lib/mastodon/*_cli.rb'
|
2016-11-15 16:56:29 +01:00
|
|
|
|
|
|
|
Metrics/CyclomaticComplexity:
|
2023-02-16 07:33:50 +01:00
|
|
|
Max: 12 # Default 7
|
2020-09-01 03:04:00 +02: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 16:39:59 +01:00
|
|
|
- lib/mastodon/*cli*.rb
|
|
|
|
- db/*migrate/**/*
|
2017-06-01 17:24:30 +02:00
|
|
|
|
2016-11-15 16:56:29 +01:00
|
|
|
Metrics/MethodLength:
|
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 16:39:59 +01:00
|
|
|
Max: 25 # RuboCop default 10
|
2023-02-16 07:33:50 +01:00
|
|
|
CountAsOne: [array, heredoc]
|
2020-09-01 03:04:00 +02:00
|
|
|
Exclude:
|
|
|
|
- 'lib/mastodon/*_cli.rb'
|
2016-11-15 16:56:29 +01:00
|
|
|
|
|
|
|
Metrics/ModuleLength:
|
2023-02-16 07:33:50 +01:00
|
|
|
Max: 200 # Default 100
|
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 16:39:59 +01:00
|
|
|
CountAsOne: [array, heredoc]
|
2016-11-15 16:56:29 +01:00
|
|
|
|
2017-06-01 17:24:30 +02:00
|
|
|
Metrics/PerceivedComplexity:
|
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 16:39:59 +01:00
|
|
|
Max: 16 # RuboCop default 8
|
2018-08-26 19:22:46 +02:00
|
|
|
|
2023-02-20 03:16:40 +01:00
|
|
|
Rails/HttpStatus:
|
|
|
|
EnforcedStyle: numeric
|
|
|
|
|
2018-09-14 17:42:22 +02:00
|
|
|
Rails/Exit:
|
|
|
|
Exclude:
|
2023-02-16 07:33:50 +01:00
|
|
|
- 'lib/mastodon/*_cli.rb'
|
|
|
|
- 'lib/mastodon/cli_helper.rb'
|
2019-03-28 17:56:25 +01:00
|
|
|
- 'lib/cli.rb'
|
2018-09-14 17:42:22 +02:00
|
|
|
|
2023-03-03 21:06:31 +01:00
|
|
|
RSpec/FilePath:
|
|
|
|
CustomTransform:
|
|
|
|
DeepL: deepl
|
|
|
|
|
2023-02-20 02:33:27 +01:00
|
|
|
RSpec/NotToNot:
|
|
|
|
EnforcedStyle: to_not
|
|
|
|
|
2023-02-20 03:16:40 +01:00
|
|
|
RSpec/Rails/HttpStatus:
|
|
|
|
EnforcedStyle: numeric
|
|
|
|
|
2022-11-17 11:05:39 +01:00
|
|
|
Style/HashSyntax:
|
|
|
|
EnforcedStyle: ruby19_no_mixed_keys
|
|
|
|
|
2023-02-18 03:05:57 +01:00
|
|
|
Style/NumericLiterals:
|
|
|
|
AllowedPatterns:
|
|
|
|
- \d{4}_\d{2}_\d{2}_\d{6} # For DB migration date version number readability
|
|
|
|
|
2017-06-08 13:24:28 +02:00
|
|
|
Style/PercentLiteralDelimiters:
|
|
|
|
PreferredDelimiters:
|
|
|
|
'%i': '()'
|
|
|
|
'%w': '()'
|
|
|
|
|
2023-02-20 11:01:20 +01:00
|
|
|
Style/RescueStandardError:
|
|
|
|
EnforcedStyle: implicit
|
|
|
|
|
2018-06-04 14:49:10 +02:00
|
|
|
Style/TrailingCommaInArrayLiteral:
|
|
|
|
EnforcedStyleForMultiline: 'comma'
|
|
|
|
|
|
|
|
Style/TrailingCommaInHashLiteral:
|
2017-06-01 17:24:30 +02:00
|
|
|
EnforcedStyleForMultiline: 'comma'
|
2023-03-03 22:55:43 +01:00
|
|
|
|
|
|
|
Style/SymbolArray:
|
|
|
|
Enabled: false
|