Commit graph

73 commits

Author SHA1 Message Date
Matt Jankowski
b3dab17b58
Remove deprecated RSpec/FilePath cop (#28601) 2024-01-05 12:31:18 +00:00
Matt Jankowski
51d2b80ff7
Solve Abc/* metrics for db/*migrate* files (#28568) 2024-01-03 13:22:03 +00:00
Matt Jankowski
0b42cf2979
Opt out of Rails/NegateInclude cop (#28370) 2023-12-18 12:21:45 +00:00
Matt Jankowski
8e9e7d57d8
Opt out of Rails/UnusedIgnoredColumns cop (#28385) 2023-12-18 09:58:53 +00:00
Matt Jankowski
3e336fe706
Opt out of Rails/SkipsModelValidations cop in db/migrate (#28371) 2023-12-15 14:38:12 +00:00
Matt Jankowski
d6f50839e1
Fix RSpec/SpecFilePathFormat cops (#27730) 2023-11-06 16:25:40 +00:00
Matt Jankowski
7ef56d6e50
Move json_ld context loaders to config/initializers (#27590) 2023-10-31 15:21:23 +00:00
Nick Schonning
8bb4706e11
Move migration_helpers Rubocop ignore to config (#24236) 2023-10-03 14:58:40 +02:00
Matt Jankowski
937dc42f10
Extract methods for file movement in CLI::Upgrade (#25120) 2023-09-28 16:04:05 +02:00
Matt Jankowski
ad81be6c8e
Update rubocop rules for linelength (#26190) 2023-07-28 23:11:45 +02:00
Matt Jankowski
f48d345de1
Use correct naming on controller concern specs (#26197) 2023-07-27 14:27:21 +02:00
Nick Schonning
f134a5f9d8
Run Rubocop on Rakefile (#23871) 2023-07-12 09:47:54 +02:00
Nick Schonning
9e8bc56d5a
Enable Rubocop Style/Semicolon with config (#23652) 2023-07-12 09:44:15 +02:00
Jed Fox
768b00c4d0
Consistently use middle dot (·) instead of bullet (•) to separate items (#25248) 2023-06-02 19:58:18 +02:00
Renaud Chaput
b7d995cb00
Disable some metrics cops (#25215) 2023-05-31 23:33:10 +02:00
Matt Jankowski
b6b4ea4ca5
Move the mastodon/*_cli files to mastodon/cli/* (#24139) 2023-05-23 16:08:26 +02:00
Matt Jankowski
541f64b2bb
Fix Rails/Exit cop (#24743) 2023-05-23 13:26:10 +02:00
eggplants
af7bf59b3e
Fix wrong documentation link (#24924) 2023-05-09 14:56:02 +02:00
Nick Schonning
1fe04f740a
Enable Rubocop Rails/FilePath (#23854) 2023-05-04 05:50:40 +02:00
Matt Jankowski
41eb49b984
Extract large route namespace blocks to separate files (#23914) 2023-05-02 15:41:20 +02:00
Claire
32a030dd74
Rewrite import feature (#21054) 2023-05-02 12:08:48 +02:00
Nick Schonning
49fad26eca
Drop EOL Ruby 2.7 (#24237) 2023-04-27 01:46:18 +02:00
Nick Schonning
1f19d5e5e8
Add documentation for Rubocop overrides (#23811) 2023-03-31 16:08:53 +02:00
Nick Schonning
83fc97285b
Enable Rubocop Metrics/BlockLength with Excludes (#24260) 2023-03-31 09:33:25 +02:00
Eugen Rochko
a9b5598c97
Change user settings to be stored in a more optimal way (#23630)
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-03-30 14:44:00 +02:00
Nick Schonning
503022d6f9
Exclude files for Rubocop Metrics/ClassLength (#24213) 2023-03-23 23:19:41 +01:00
Nick Schonning
b22b4bac03
Include config/ and update all rubcop deps (#23963) 2023-03-17 10:13:28 +01:00
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>
2023-03-16 22:24:01 +01:00
Nick Schonning
aa947a143b
Regen rubocop-todo without Max shadowing (#24076) 2023-03-16 12:31:08 +09:00
Nick Schonning
3ea0856f70
Enable RSpec/FilePath (#23965) 2023-03-10 16:32:37 +01:00
Nick Schonning
82a6cf4012
Enable Rubocop for app/views (#23874) 2023-03-05 00:33:52 +01:00
Claire
aa98c8fbeb
Disable Style/SymbolArray (#23921) 2023-03-03 22:55:43 +01:00
Christian Schmidt
5a8c651e8f
Only offer translation for supported languages (#23879) 2023-03-03 21:06:31 +01:00
Nick Schonning
59c8d43d94
Autofix Rubocop Style/RescueStandardError (#23745) 2023-02-20 11:01:20 +01:00
Nick Schonning
aef0051fd0
Enable Rubocop HTTP status rules (#23717) 2023-02-20 11:16:40 +09:00
Nick Schonning
65ba0d92ef
Enable Rubocop RSpec/NotToNot (#23723) 2023-02-20 02:33:27 +01:00
Nick Schonning
7a941b42d3
Remove Style/Copyright Rubocop (#23665) 2023-02-18 03:26:41 +01:00
Nick Schonning
ac59d6f19f
Enable Rubocop Style/NumericLiterals (#23647) 2023-02-18 11:05:57 +09:00
Nick Schonning
68a92c81bf
Generate minimimal Rubocop Todo file (#23629) 2023-02-16 15:33:50 +09:00
Nick Schonning
3c70f0a9c9
Run Prettier on YML files (#22345) 2022-12-16 11:11:52 +09:00
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
2022-12-15 16:39:59 +01:00
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.
2022-11-27 20:41:39 +01:00
Rose
4f15fd0ba1
Fix style for hashes (#20518)
* Fix style for hashes

Make the style for hashes consistent.

* New style

More consistency
2022-11-17 11:05:39 +01:00
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
2022-07-05 02:41:40 +02:00
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
2022-06-09 22:25:23 +02:00
Yamagishi Kazutoshi
584d8b977b
Format JSON and YAML using Prettier (#17823)
* Format JSON and YAML using Prettier

* Add prettier to devDep
2022-03-21 04:46:11 +01:00
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
2022-03-12 08:33:11 +01:00
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
2022-02-25 00:34:14 +01:00
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
2021-01-07 09:40:55 +01:00
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>
2020-09-01 03:04:00 +02:00