Skip to content

Commit d052ff2

Browse files
authored
DEV: Update linting (#70)
1 parent e117a93 commit d052ff2

File tree

9 files changed

+1209
-1311
lines changed

9 files changed

+1209
-1311
lines changed

Gemfile.lock

Lines changed: 53 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (7.2.1.1)
4+
activesupport (8.0.2)
55
base64
6+
benchmark (>= 0.3)
67
bigdecimal
78
concurrent-ruby (~> 1.0, >= 1.3.1)
89
connection_pool (>= 2.2.5)
@@ -12,68 +13,81 @@ GEM
1213
minitest (>= 5.1)
1314
securerandom (>= 0.3)
1415
tzinfo (~> 2.0, >= 2.0.5)
16+
uri (>= 0.13.1)
1517
ast (2.4.2)
1618
base64 (0.2.0)
17-
bigdecimal (3.1.8)
18-
concurrent-ruby (1.3.4)
19-
connection_pool (2.4.1)
19+
benchmark (0.4.0)
20+
bigdecimal (3.1.9)
21+
concurrent-ruby (1.3.5)
22+
connection_pool (2.5.0)
2023
drb (2.2.1)
21-
i18n (1.14.6)
24+
i18n (1.14.7)
2225
concurrent-ruby (~> 1.0)
23-
json (2.7.2)
24-
language_server-protocol (3.17.0.3)
25-
logger (1.6.1)
26-
minitest (5.25.1)
26+
json (2.10.2)
27+
language_server-protocol (3.17.0.4)
28+
lint_roller (1.1.0)
29+
logger (1.6.6)
30+
minitest (5.25.5)
2731
parallel (1.26.3)
28-
parser (3.3.5.0)
32+
parser (3.3.7.1)
2933
ast (~> 2.4.1)
3034
racc
3135
prettier_print (1.2.1)
3236
racc (1.8.1)
33-
rack (3.1.10)
37+
rack (3.1.12)
3438
rainbow (3.1.1)
35-
regexp_parser (2.9.2)
36-
rubocop (1.67.0)
39+
regexp_parser (2.10.0)
40+
rubocop (1.74.0)
3741
json (~> 2.3)
38-
language_server-protocol (>= 3.17.0)
42+
language_server-protocol (~> 3.17.0.2)
43+
lint_roller (~> 1.1.0)
3944
parallel (~> 1.10)
4045
parser (>= 3.3.0.2)
4146
rainbow (>= 2.2.2, < 4.0)
42-
regexp_parser (>= 2.4, < 3.0)
43-
rubocop-ast (>= 1.32.2, < 2.0)
47+
regexp_parser (>= 2.9.3, < 3.0)
48+
rubocop-ast (>= 1.38.0, < 2.0)
4449
ruby-progressbar (~> 1.7)
45-
unicode-display_width (>= 2.4.0, < 3.0)
46-
rubocop-ast (1.32.3)
50+
unicode-display_width (>= 2.4.0, < 4.0)
51+
rubocop-ast (1.39.0)
4752
parser (>= 3.3.1.0)
48-
rubocop-capybara (2.21.0)
49-
rubocop (~> 1.41)
50-
rubocop-discourse (3.8.2)
53+
rubocop-capybara (2.22.1)
54+
lint_roller (~> 1.1)
55+
rubocop (~> 1.72, >= 1.72.1)
56+
rubocop-discourse (3.12.1)
5157
activesupport (>= 6.1)
52-
rubocop (>= 1.59.0)
53-
rubocop-capybara (>= 2.0.0)
54-
rubocop-factory_bot (>= 2.0.0)
55-
rubocop-rails (>= 2.25.0)
58+
lint_roller (>= 1.1.0)
59+
rubocop (>= 1.73.2)
60+
rubocop-capybara (>= 2.22.0)
61+
rubocop-factory_bot (>= 2.27.0)
62+
rubocop-rails (>= 2.30.3)
5663
rubocop-rspec (>= 3.0.1)
57-
rubocop-rspec_rails (>= 2.30.0)
58-
rubocop-factory_bot (2.26.1)
59-
rubocop (~> 1.61)
60-
rubocop-rails (2.26.2)
64+
rubocop-rspec_rails (>= 2.31.0)
65+
rubocop-factory_bot (2.27.1)
66+
lint_roller (~> 1.1)
67+
rubocop (~> 1.72, >= 1.72.1)
68+
rubocop-rails (2.30.3)
6169
activesupport (>= 4.2.0)
70+
lint_roller (~> 1.1)
6271
rack (>= 1.1)
63-
rubocop (>= 1.52.0, < 2.0)
64-
rubocop-ast (>= 1.31.1, < 2.0)
65-
rubocop-rspec (3.1.0)
66-
rubocop (~> 1.61)
67-
rubocop-rspec_rails (2.30.0)
68-
rubocop (~> 1.61)
69-
rubocop-rspec (~> 3, >= 3.0.1)
72+
rubocop (>= 1.72.1, < 2.0)
73+
rubocop-ast (>= 1.38.0, < 2.0)
74+
rubocop-rspec (3.5.0)
75+
lint_roller (~> 1.1)
76+
rubocop (~> 1.72, >= 1.72.1)
77+
rubocop-rspec_rails (2.31.0)
78+
lint_roller (~> 1.1)
79+
rubocop (~> 1.72, >= 1.72.1)
80+
rubocop-rspec (~> 3.5)
7081
ruby-progressbar (1.13.0)
71-
securerandom (0.3.1)
82+
securerandom (0.4.1)
7283
syntax_tree (6.2.0)
7384
prettier_print (>= 1.2.0)
7485
tzinfo (2.0.6)
7586
concurrent-ruby (~> 1.0)
76-
unicode-display_width (2.6.0)
87+
unicode-display_width (3.1.4)
88+
unicode-emoji (~> 4.0, >= 4.0.4)
89+
unicode-emoji (4.0.4)
90+
uri (1.0.3)
7791

7892
PLATFORMS
7993
arm64-darwin-23
@@ -84,4 +98,4 @@ DEPENDENCIES
8498
syntax_tree
8599

86100
BUNDLED WITH
87-
2.5.21
101+
2.6.6

common/common.scss

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
.background-thumbnail {
2121
display: none;
2222
}
23+
2324
.main-thumbnail {
2425
object-fit: cover;
2526
}
@@ -32,7 +33,6 @@
3233
object-fit: cover;
3334

3435
$blur_size: 4px;
35-
3636
filter: blur(#{$blur_size});
3737
width: calc(100% + 4 * #{$blur_size});
3838
height: calc(100% + 4 * #{$blur_size});
@@ -41,7 +41,7 @@
4141
}
4242

4343
// Tint background to blend with $secondary
44-
&:after {
44+
&::after {
4545
z-index: 1;
4646
content: "";
4747
display: block;
@@ -71,6 +71,7 @@
7171
display: flex;
7272
align-items: center;
7373
justify-content: center;
74+
7475
.d-icon {
7576
width: 60%;
7677
height: 60%;
@@ -93,7 +94,6 @@
9394
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
9495
grid-column-gap: 5px;
9596
grid-row-gap: 5px;
96-
9797
border: 0;
9898
}
9999

@@ -102,15 +102,12 @@
102102
position: relative;
103103
min-width: 0;
104104
height: 250px;
105-
106105
grid-template-areas:
107106
" image image "
108107
" title activity"
109108
" title posters";
110-
111109
grid-template-rows: 1fr auto;
112110
grid-template-columns: 1fr auto;
113-
114111
background-color: var(--primary-low);
115112
border: 1px solid var(--primary-low);
116113

@@ -122,12 +119,14 @@
122119

123120
.topic-list-thumbnail {
124121
z-index: 0;
122+
125123
// position: absolute;
126124
width: 100%;
127125
height: 100%;
128126
top: 0;
129127
left: 0;
130128
grid-area: image;
129+
131130
.background-thumbnail {
132131
height: calc(150%);
133132
}
@@ -144,9 +143,7 @@
144143

145144
&.topic-list .posters {
146145
height: auto;
147-
padding-top: 0;
148146
grid-area: posters;
149-
150147
padding: 0 10px 10px 10px;
151148
display: flex;
152149
justify-content: flex-end;
@@ -160,6 +157,7 @@
160157
&:first-of-type {
161158
display: block;
162159
}
160+
163161
&:not(:first-of-type) {
164162
display: none;
165163
}
@@ -183,10 +181,8 @@
183181

184182
.num.activity {
185183
grid-area: activity;
186-
187184
display: flex;
188185
justify-content: flex-end;
189-
190186
width: auto;
191187
padding: 10px;
192188

@@ -225,8 +221,10 @@
225221
grid-template-rows: 1fr 45px;
226222
grid-template-columns: 70% minmax(0, 15%) minmax(0, 15%);
227223
border-bottom: none;
224+
228225
&.visited {
229226
background-color: transparent !important;
227+
230228
.link-top-line {
231229
color: var(--primary-medium);
232230
}
@@ -263,10 +261,12 @@
263261
align-items: center;
264262
color: var(--primary-low-mid);
265263
overflow: hidden;
264+
266265
.number {
267266
font-size: 13px;
268267
font-weight: bold;
269268
}
269+
270270
.d-icon {
271271
font-size: 13px;
272272
margin-right: 0.5em;
@@ -276,28 +276,28 @@
276276
.posts-map {
277277
padding: 0;
278278
grid-area: posts;
279-
width: auto;
280279
display: flex;
281280
justify-content: center;
282281
align-items: center;
283282
overflow: hidden;
284283
width: auto !important; // overrides very specific core style
284+
285285
.badge-posts {
286286
padding: 0;
287287
}
288+
288289
span.number {
289290
color: var(--primary-low-mid);
290291
display: flex;
291292
justify-content: flex-end;
292293
align-items: center;
293294
font-size: 13px;
294-
&:before {
295+
296+
&::before {
295297
content: "";
296298
background-color: var(--primary-low-mid);
297299
mask-repeat: no-repeat;
298-
-webkit-mask-repeat: no-repeat;
299300
mask-image: url('data:image/svg+xml; utf8, <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="comment" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-comment fa-w-16 fa-2x"><path fill="gray" d="M256 32C114.6 32 0 125.1 0 240c0 49.6 21.4 95 57 130.7C44.5 421.1 2.7 466 2.2 466.5c-2.2 2.3-2.8 5.7-1.5 8.7S4.8 480 8 480c66.3 0 116-31.8 140.6-51.4 32.7 12.3 69 19.4 107.4 19.4 141.4 0 256-93.1 256-208S397.4 32 256 32z" class=""></path></svg>');
300-
-webkit-mask-image: url('data:image/svg+xml; utf8, <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="comment" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-comment fa-w-16 fa-2x"><path fill="gray" d="M256 32C114.6 32 0 125.1 0 240c0 49.6 21.4 95 57 130.7C44.5 421.1 2.7 466 2.2 466.5c-2.2 2.3-2.8 5.7-1.5 8.7S4.8 480 8 480c66.3 0 116-31.8 140.6-51.4 32.7 12.3 69 19.4 107.4 19.4 141.4 0 256-93.1 256-208S397.4 32 256 32z" class=""></path></svg>');
301301
display: block;
302302
height: 13px;
303303
width: 13px;
@@ -314,11 +314,13 @@
314314
justify-content: center;
315315
font-weight: 600;
316316
width: 100%;
317+
317318
.link-top-line {
318319
white-space: nowrap;
319320
overflow: hidden;
320321
text-overflow: ellipsis;
321322
color: var(--primary);
323+
322324
a.title {
323325
color: var(--primary);
324326
padding: 0 !important;
@@ -356,15 +358,19 @@
356358

357359
.main-link {
358360
grid-area: content;
361+
359362
.docs-topic-link {
360363
display: unset;
361364
}
365+
362366
.link-top-line {
363367
color: var(--tertiary);
364368
}
365369
}
370+
366371
.link-bottom-line {
367372
display: block;
373+
368374
.badge-wrapper {
369375
display: none;
370376
}
@@ -400,14 +406,17 @@
400406
align-items: center;
401407
color: var(--primary-low-mid);
402408
width: auto;
409+
403410
.number {
404411
font-size: var(--font-down-1);
405412
font-weight: bold;
406413
}
414+
407415
.d-icon {
408416
font-size: var(--font-down-1);
409417
margin-right: 0.5em;
410418
}
419+
411420
a {
412421
color: var(--primary-low-mid);
413422
font-size: var(--font-down-1);
@@ -424,23 +433,19 @@
424433
--masonry-grid-spacing
425434
--masonry-column-width
426435
*/
427-
428436
position: relative;
429437
height: var(--masonry-tallest-column);
430438

431439
.topic-list-item {
432440
/*
433441
Variables set by javascript:
434-
--masonry-height
435-
--masonry-height-above
442+
--masonry-height
443+
--masonry-height-above
436444
--masonry-column-index
437445
*/
438-
439446
position: absolute;
440-
441447
height: var(--masonry-height);
442448
width: var(--masonry-column-width);
443-
444449
left: calc(
445450
(var(--masonry-column-width) + var(--masonry-grid-spacing)) *
446451
var(--masonry-column-index)

javascripts/discourse/connectors/before-topic-list-body/topic-list-masonry-styles.gjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ export default class TopicListMasonryStyles extends Component {
5353
<template>
5454
{{#if this.topicThumbnails.displayMasonry}}
5555
{{! template-lint-disable no-forbidden-elements }}
56-
<style {{this.attachResizeObserver}}>
56+
<style
57+
{{this.attachResizeObserver}}
58+
>
5759
{{this.masonryStyle}}
5860
</style>
5961
{{/if}}

javascripts/discourse/initializers/topic-thumbnails-init-legacy.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { service } from "@ember/service";
44
import { withSilencedDeprecations } from "discourse/lib/deprecated";
55
import { withPluginApi } from "discourse/lib/plugin-api";
66
import { getResolverOption, setResolverOption } from "discourse/resolver";
7+
78
export default {
89
name: "topic-thumbnails-init",
910
initialize() {

0 commit comments

Comments
 (0)