Skip to content

Commit 6dee379

Browse files
authored
DEV: Update linting setup and fix issues (#45)
1 parent 1ce0775 commit 6dee379

16 files changed

+1307
-938
lines changed

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
node_modules
2-
yarn-error.log
3-
.rubocop-https---raw-githubusercontent-com-discourse-*
2+
/gems
3+
/auto_generated

.prettierrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

Gemfile

-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
source 'https://rubygems.org'
44

55
group :development do
6-
gem 'translations-manager', git: 'https://github.com/discourse/translations-manager.git'
76
gem 'rubocop-discourse'
87
end

Gemfile.lock

+27-26
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,42 @@
1-
GIT
2-
remote: https://github.com/discourse/translations-manager.git
3-
revision: d6da5ff928b9ea39a15c9b6f16b856f46bc9069b
4-
specs:
5-
translations-manager (0.6)
6-
71
GEM
82
remote: https://rubygems.org/
93
specs:
10-
ast (2.4.0)
11-
jaro_winkler (1.5.4)
12-
parallel (1.19.1)
13-
parser (2.7.1.2)
14-
ast (~> 2.4.0)
15-
rainbow (3.0.0)
4+
ast (2.4.2)
5+
parallel (1.22.1)
6+
parser (3.1.2.0)
7+
ast (~> 2.4.1)
8+
rainbow (3.1.1)
9+
regexp_parser (2.5.0)
1610
rexml (3.2.5)
17-
rubocop (0.82.0)
18-
jaro_winkler (~> 1.5.1)
11+
rubocop (1.30.1)
1912
parallel (~> 1.10)
20-
parser (>= 2.7.0.1)
13+
parser (>= 3.1.0.0)
2114
rainbow (>= 2.2.2, < 4.0)
22-
rexml
15+
regexp_parser (>= 1.8, < 3.0)
16+
rexml (>= 3.2.5, < 4.0)
17+
rubocop-ast (>= 1.18.0, < 2.0)
2318
ruby-progressbar (~> 1.7)
24-
unicode-display_width (>= 1.4.0, < 2.0)
25-
rubocop-discourse (2.1.2)
26-
rubocop (>= 0.69.0)
27-
rubocop-rspec (>= 1.39.0)
28-
rubocop-rspec (1.39.0)
29-
rubocop (>= 0.68.1)
30-
ruby-progressbar (1.10.1)
31-
unicode-display_width (1.7.0)
19+
unicode-display_width (>= 1.4.0, < 3.0)
20+
rubocop-ast (1.18.0)
21+
parser (>= 3.1.1.0)
22+
rubocop-discourse (2.5.0)
23+
rubocop (>= 1.1.0)
24+
rubocop-rspec (>= 2.0.0)
25+
rubocop-rspec (2.11.1)
26+
rubocop (~> 1.19)
27+
ruby-progressbar (1.11.0)
28+
unicode-display_width (2.1.0)
3229

3330
PLATFORMS
31+
arm64-darwin-20
3432
ruby
33+
x86_64-darwin-18
34+
x86_64-darwin-19
35+
x86_64-darwin-20
36+
x86_64-linux
3537

3638
DEPENDENCIES
3739
rubocop-discourse
38-
translations-manager!
3940

4041
BUNDLED WITH
41-
2.1.4
42+
2.3.10

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2021 Civilized Discourse Construction Kit
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ Import RSS feeds from different sources into your Discourse.
44

55
## Install
66

7-
Add `git clone https://github.com/discourse/discourse-rss-polling.git` to the plugin section in your `app.yml` file. Please refer to [Install Plugins in Discourse](https://meta.discourse.org/t/install-plugins-in-discourse/19157) for installation instructions.
7+
Add `git clone https://github.com/discourse/discourse-rss-polling.git` to the plugin section in your `app.yml` file. Please refer to [Install Plugins in Discourse](https://meta.discourse.org/t/install-plugins-in-discourse/19157) for installation instructions.
88

99
Documentation can be found at [Configure the Discourse RSS Polling Plugin.](https://meta.discourse.org/t/configure-the-discourse-rss-polling-plugin/156387)

assets/javascripts/discourse/controllers/admin-plugins-rss-polling.js.es6 assets/javascripts/discourse/controllers/admin-plugins-rss-polling.js

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1+
import Controller from "@ember/controller";
12
import RssPollingFeedSettings from "../../admin/models/rss-polling-feed-settings";
23
import { set } from "@ember/object";
34
import { alias } from "@ember/object/computed";
5+
import discourseComputed, { observes } from "discourse-common/utils/decorators";
6+
import { isBlank } from "@ember/utils";
47

5-
import {
6-
default as computed,
7-
observes,
8-
} from "discourse-common/utils/decorators";
9-
10-
export default Ember.Controller.extend({
8+
export default Controller.extend({
119
feedSettings: alias("model"),
1210
saving: false,
1311
valid: false,
1412

15-
@computed("valid", "saving")
13+
@discourseComputed("valid", "saving")
1614
unsavable(valid, saving) {
1715
return !valid || saving;
1816
},
@@ -24,9 +22,8 @@ export default Ember.Controller.extend({
2422

2523
this.get("feedSettings").forEach((feedSetting) => {
2624
const localValidity =
27-
!Ember.isBlank(feedSetting.feed_url) &&
28-
!Ember.isBlank(feedSetting.author_username);
29-
Ember.set(feedSetting, "valid", localValidity);
25+
!isBlank(feedSetting.feed_url) && !isBlank(feedSetting.author_username);
26+
set(feedSetting, "valid", localValidity);
3027
overallValidity = overallValidity && localValidity;
3128
});
3229

assets/javascripts/discourse/templates/admin/plugins-rss-polling.hbs

+8-4
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@
4444
value=setting.author_username
4545
disabled=saving
4646
onChange=(action "updateAuthorUsername" setting)
47-
options=(hash
48-
maximum=1
49-
)
47+
options=(hash maximum=1)
5048
}}
5149
</td>
5250
<td>
@@ -97,5 +95,11 @@
9795
</tfoot>
9896
</table>
9997

100-
<p><a href="https://meta.discourse.org/t/configure-the-discourse-rss-polling-plugin/156387">{{i18n "admin.rss_polling.documentation"}}</a></p>
98+
<p>
99+
<a
100+
href="https://meta.discourse.org/t/configure-the-discourse-rss-polling-plugin/156387"
101+
>
102+
{{i18n "admin.rss_polling.documentation"}}
103+
</a>
104+
</p>
101105
</div>

config/locales/server.en.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
en:
22
site_settings:
3-
rss_polling_enabled: '[RSS Polling] Enable importing embed posts from multiple RSS feeds'
4-
rss_polling_frequency: '[RSS Polling] Feed polling frequency, in minutes'
3+
rss_polling_enabled: "[RSS Polling] Enable importing embed posts from multiple RSS feeds"
4+
rss_polling_frequency: "[RSS Polling] Feed polling frequency, in minutes"

config/settings.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ plugins:
66
# This stores a YAML serialized array of feed setting tuples, in the format of
77
# [feed_url, author_username]
88
rss_polling_feed_setting:
9-
default: '[]'
9+
default: "[]"
1010
hidden: true
1111
client: false
1212

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
2+
"name": "discourse-rss-polling",
3+
"version": "0.0.1",
4+
"repository": "https://github.com/discourse/discourse-rss-polling",
25
"author": "Discourse",
36
"license": "MIT",
47
"devDependencies": {
5-
"eslint-config-discourse": "latest"
8+
"eslint-config-discourse": "^3.2.0"
69
}
710
}

plugin.rb

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
# version: 0.0.1
66
# authors: xrav3nz
77
# url: https://github.com/discourse/discourse-rss-polling
8+
# transpile_js: true
89

910
load File.expand_path(File.join('..', 'lib', 'discourse_rss_polling', 'engine.rb'), __FILE__)
1011

0 commit comments

Comments
 (0)