Skip to content

Commit a3b3e72

Browse files
authored
Update ruby linter and formatter (#139)
* Update ruby linter and formatter * Update linters to match Discourse Plugin Skeleton * Fix dependencies * Run linters
1 parent e361019 commit a3b3e72

File tree

24 files changed

+2483
-2406
lines changed

24 files changed

+2483
-2406
lines changed

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 1 deletion
This file was deleted.

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
yarn lint-staged

.prettierrc

Lines changed: 0 additions & 5 deletions
This file was deleted.

.prettierrc.cjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
...require("@discourse/lint-configs/prettier"),
3+
printWidth: 100,
4+
tabWidth: 2,
5+
useTabs: false,
6+
};

.streerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
--print-width=100
2-
--plugins=plugin/trailing_comma,disable_ternary
2+
--plugins=plugin/trailing_comma,plugin/disable_auto_ternary

.vscode/extensions.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
{
2-
"recommendations": [
3-
"dbaeumer.vscode-eslint"
4-
]
5-
}
2+
"recommendations": ["dbaeumer.vscode-eslint"]
3+
}

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,4 @@ source "https://rubygems.org"
55
group :development do
66
gem "rubocop-discourse"
77
gem "syntax_tree"
8-
gem "syntax_tree-disable_ternary"
98
end

Gemfile.lock

Lines changed: 65 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,87 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4+
activesupport (7.1.3.3)
5+
base64
6+
bigdecimal
7+
concurrent-ruby (~> 1.0, >= 1.0.2)
8+
connection_pool (>= 2.2.5)
9+
drb
10+
i18n (>= 1.6, < 2)
11+
minitest (>= 5.1)
12+
mutex_m
13+
tzinfo (~> 2.0)
414
ast (2.4.2)
5-
json (2.6.2)
6-
parallel (1.22.1)
7-
parser (3.1.2.1)
15+
base64 (0.2.0)
16+
bigdecimal (3.1.8)
17+
concurrent-ruby (1.2.3)
18+
connection_pool (2.4.1)
19+
drb (2.2.1)
20+
i18n (1.14.5)
21+
concurrent-ruby (~> 1.0)
22+
json (2.7.2)
23+
language_server-protocol (3.17.0.3)
24+
minitest (5.23.1)
25+
mutex_m (0.2.0)
26+
parallel (1.24.0)
27+
parser (3.3.1.0)
828
ast (~> 2.4.1)
9-
prettier_print (1.2.0)
29+
racc
30+
prettier_print (1.2.1)
31+
racc (1.8.0)
32+
rack (3.0.12)
1033
rainbow (3.1.1)
11-
regexp_parser (2.6.0)
12-
rexml (3.2.5)
13-
rubocop (1.36.0)
34+
regexp_parser (2.9.2)
35+
rexml (3.3.9)
36+
rubocop (1.64.0)
1437
json (~> 2.3)
38+
language_server-protocol (>= 3.17.0)
1539
parallel (~> 1.10)
16-
parser (>= 3.1.2.1)
40+
parser (>= 3.3.0.2)
1741
rainbow (>= 2.2.2, < 4.0)
1842
regexp_parser (>= 1.8, < 3.0)
1943
rexml (>= 3.2.5, < 4.0)
20-
rubocop-ast (>= 1.20.1, < 2.0)
44+
rubocop-ast (>= 1.31.1, < 2.0)
2145
ruby-progressbar (~> 1.7)
22-
unicode-display_width (>= 1.4.0, < 3.0)
23-
rubocop-ast (1.21.0)
24-
parser (>= 3.1.1.0)
25-
rubocop-discourse (3.0)
26-
rubocop (>= 1.1.0)
27-
rubocop-rspec (>= 2.0.0)
28-
rubocop-rspec (2.13.2)
29-
rubocop (~> 1.33)
30-
ruby-progressbar (1.11.0)
31-
syntax_tree (5.1.0)
46+
unicode-display_width (>= 2.4.0, < 3.0)
47+
rubocop-ast (1.31.3)
48+
parser (>= 3.3.1.0)
49+
rubocop-capybara (2.20.0)
50+
rubocop (~> 1.41)
51+
rubocop-discourse (3.8.0)
52+
activesupport (>= 6.1)
53+
rubocop (>= 1.59.0)
54+
rubocop-capybara (>= 2.0.0)
55+
rubocop-factory_bot (>= 2.0.0)
56+
rubocop-rails (>= 2.25.0)
57+
rubocop-rspec (>= 2.25.0)
58+
rubocop-factory_bot (2.25.1)
59+
rubocop (~> 1.41)
60+
rubocop-rails (2.25.0)
61+
activesupport (>= 4.2.0)
62+
rack (>= 1.1)
63+
rubocop (>= 1.33.0, < 2.0)
64+
rubocop-ast (>= 1.31.1, < 2.0)
65+
rubocop-rspec (2.29.2)
66+
rubocop (~> 1.40)
67+
rubocop-capybara (~> 2.17)
68+
rubocop-factory_bot (~> 2.22)
69+
rubocop-rspec_rails (~> 2.28)
70+
rubocop-rspec_rails (2.28.3)
71+
rubocop (~> 1.40)
72+
ruby-progressbar (1.13.0)
73+
syntax_tree (6.2.0)
3274
prettier_print (>= 1.2.0)
33-
syntax_tree-disable_ternary (1.0.0)
34-
unicode-display_width (2.3.0)
75+
tzinfo (2.0.6)
76+
concurrent-ruby (~> 1.0)
77+
unicode-display_width (2.5.0)
3578

3679
PLATFORMS
37-
arm64-darwin-20
3880
ruby
39-
x86_64-darwin-18
40-
x86_64-darwin-19
41-
x86_64-darwin-20
42-
x86_64-linux
4381

4482
DEPENDENCIES
4583
rubocop-discourse
4684
syntax_tree
47-
syntax_tree-disable_ternary
4885

4986
BUNDLED WITH
50-
2.3.10
87+
2.5.10

app/controllers/bb_code/admin/refresh_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
module ::BbCode
44
module Admin
55
class RefreshController < ::Admin::AdminController
6+
requires_plugin PLUGIN_NAME
67
def index
78
PrettyText.reset_context
89
begin

0 commit comments

Comments
 (0)