Commit Graph

69 Commits (f99e05710ea06cf10bbd3fb64ae8c00b095cb455)

Author SHA1 Message Date
Matt Jankowski 3e336fe706
Opt out of `Rails/SkipsModelValidations` cop in db/migrate (#28371) 1 year ago
Matt Jankowski d6f50839e1
Fix `RSpec/SpecFilePathFormat` cops (#27730) 1 year ago
Matt Jankowski 7ef56d6e50
Move json_ld context loaders to `config/initializers` (#27590) 1 year ago
Nick Schonning 8bb4706e11
Move migration_helpers Rubocop ignore to config (#24236) 1 year ago
Matt Jankowski 937dc42f10
Extract methods for file movement in `CLI::Upgrade` (#25120) 1 year ago
Matt Jankowski ad81be6c8e
Update rubocop rules for linelength (#26190) 1 year ago
Matt Jankowski f48d345de1
Use correct naming on controller concern specs (#26197) 1 year ago
Nick Schonning f134a5f9d8
Run Rubocop on Rakefile (#23871) 1 year ago
Nick Schonning 9e8bc56d5a
Enable Rubocop Style/Semicolon with config (#23652) 1 year ago
Jed Fox 768b00c4d0
Consistently use middle dot (·) instead of bullet (•) to separate items (#25248) 2 years ago
Renaud Chaput b7d995cb00
Disable some metrics cops (#25215) 2 years ago
Matt Jankowski b6b4ea4ca5
Move the mastodon/*_cli files to mastodon/cli/* (#24139) 2 years ago
Matt Jankowski 541f64b2bb
Fix Rails/Exit cop (#24743) 2 years ago
eggplants af7bf59b3e
Fix wrong documentation link (#24924) 2 years ago
Nick Schonning 1fe04f740a
Enable Rubocop Rails/FilePath (#23854) 2 years ago
Matt Jankowski 41eb49b984
Extract large route namespace blocks to separate files (#23914) 2 years ago
Claire 32a030dd74
Rewrite import feature (#21054) 2 years ago
Nick Schonning 49fad26eca
Drop EOL Ruby 2.7 (#24237) 2 years ago
Nick Schonning 1f19d5e5e8
Add documentation for Rubocop overrides (#23811) 2 years ago
Nick Schonning 83fc97285b
Enable Rubocop Metrics/BlockLength with Excludes (#24260) 2 years ago
Eugen Rochko a9b5598c97
Change user settings to be stored in a more optimal way (#23630)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2 years ago
Nick Schonning 503022d6f9
Exclude files for Rubocop Metrics/ClassLength (#24213) 2 years ago
Nick Schonning b22b4bac03
Include config/ and update all rubcop deps (#23963) 2 years ago
Matt Jankowski edc7ca5920
Roll back unintentionally activated rubocop rules (#24132)
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
Co-authored-by: Nick Schonning <nschonni@gmail.com>
2 years ago
Nick Schonning aa947a143b
Regen rubocop-todo without Max shadowing (#24076) 2 years ago
Nick Schonning 3ea0856f70
Enable RSpec/FilePath (#23965) 2 years ago
Nick Schonning 82a6cf4012
Enable Rubocop for app/views (#23874) 2 years ago
Claire aa98c8fbeb
Disable Style/SymbolArray (#23921) 2 years ago
Christian Schmidt 5a8c651e8f
Only offer translation for supported languages (#23879) 2 years ago
Nick Schonning 59c8d43d94
Autofix Rubocop Style/RescueStandardError (#23745) 2 years ago
Nick Schonning aef0051fd0
Enable Rubocop HTTP status rules (#23717) 2 years ago
Nick Schonning 65ba0d92ef
Enable Rubocop RSpec/NotToNot (#23723) 2 years ago
Nick Schonning 7a941b42d3
Remove Style/Copyright Rubocop (#23665) 2 years ago
Nick Schonning ac59d6f19f
Enable Rubocop Style/NumericLiterals (#23647) 2 years ago
Nick Schonning 68a92c81bf
Generate minimimal Rubocop Todo file (#23629) 2 years ago
Nick Schonning 3c70f0a9c9
Run Prettier on YML files (#22345) 2 years ago
Kaspar V 19f78ea8fa
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
2 years ago
Claire 098ced7420
Remove support for Ruby 2.6 (#21477)
As pointed out by https://github.com/mastodon/mastodon/pull/21297#discussion_r1028372193
at least one of our dependencies already dropped support for Ruby 2.6, and we
had removed Ruby 2.6 tests from the CI over a year ago (#16861).

So stop advertising Ruby 2.6 support, bump targeted version, and drop some
compatibility code.
2 years ago
Rose 4f15fd0ba1
Fix style for hashes (#20518)
* Fix style for hashes

Make the style for hashes consistent.

* New style

More consistency
2 years ago
Eugen Rochko 44b2ee3485
Add customizable user roles (#18641)
* Add customizable user roles

* Various fixes and improvements

* Add migration for old settings and fix tootctl role management
3 years ago
Eugen Rochko 45aa5781ce
Change brand color and logotypes (#18592)
- Add rake task for generating Apple/Android icons and favicons from SVG
- Add rake task for generating PNG icons and logos for e-mails from SVG
- Remove obsolete Microsoft icons and configuration
- Remove PWA shortcut icons
3 years ago
Yamagishi Kazutoshi 584d8b977b
Format JSON and YAML using Prettier (#17823)
* Format JSON and YAML using Prettier

* Add prettier to devDep
3 years ago
Claire 642528f455
Update fix-duplicates maintenance task (#17731)
* Update fix-duplicates task to 2022_02_10_153119

Also add support for Appeal to AccountMerging#merge_with!

* Update fix-duplicates task to 2022_03_07_094650

* Update fix-duplicates task to 2022_03_09_213005

* Update fix-duplicates task to 2022_03_07_083603

* Update fix-duplicates task to 2022_03_10_060626

* Update fix-duplicates script to 2022_03_07_083603

* Update fix-duplicates task to 2022_03_10_060706

* Update fix-duplicates task to 2022_03_10_060959

* Silence CodeClimate
3 years ago
Eugen Rochko 27965ce5ed
Add trending statuses (#17431)
* Add trending statuses

* Fix dangling items with stale scores in localized sets

* Various fixes and improvements

- Change approve_all/reject_all to approve_accounts/reject_accounts
- Change Trends::Query methods to not mutate the original query
- Change Trends::Query#skip to offset
- Change follow recommendations to be refreshed in a transaction

* Add tests for trending statuses filtering behaviour

* Fix not applying filtering scope in controller
3 years ago
abcang efffdd3778
Fix rubocop config and warnings (#15503)
* disable NewCops

* update TargetRubyVersion

* Fix Lint/MissingSuper for ActiveModelSerializers::Model

* Fix Lint/MissingSuper for feed

* Fix Lint/FloatComparison

* Do not use instance variables
4 years ago
dependabot[bot] 8972e5f7f6
Bump rubocop from 0.86.0 to 0.88.0 (#14412)
* Bump rubocop from 0.86.0 to 0.88.0

Bumps [rubocop](https://github.com/rubocop-hq/rubocop) from 0.86.0 to 0.88.0.
- [Release notes](https://github.com/rubocop-hq/rubocop/releases)
- [Changelog](https://github.com/rubocop-hq/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop-hq/rubocop/compare/v0.86.0...v0.88.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Fix for latest RuboCop

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>
4 years ago
abcang 6a96af4d20
Fix rubocop warning (#14288)
* Fix rubocop warning

* use limit variable

* use ContextCreatingMethods option
5 years ago
Lerk 8012fce727
fix rubocop errors (#13690) 5 years ago
Yamagishi Kazutoshi 6be16d02cb Update ESLint and RuboCop in Code Climate (#12534) 5 years ago
Yamagishi Kazutoshi 70423ce81f require rubocop-rails in .rubocop.yml (#10974)
* Revert "Revert #10957 (rubocop-rails) which is incompatible with CodeClimate (#10965)"

This reverts commit 121d19d7fa.

* Disable Rails/HelperInstanceVariable
6 years ago