From 1e13f32cea2abf22229c2c3dc27cd105653751b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 1 Feb 2019 01:16:20 +0100 Subject: [PATCH] style: Disable camelcase rule for GObject properties For GObject properties, we follow the convention of all-lowercase, dash-separated names. Those translate to underscores in getters/setters, so exempt them from the newly added "camelcase" rule. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627 --- js/misc/systemActions.js | 7 +++++++ js/perf/core.js | 1 + js/perf/hwtest.js | 1 + js/ui/altTab.js | 1 + js/ui/layout.js | 2 ++ js/ui/padOsd.js | 4 ++++ 6 files changed, 16 insertions(+) diff --git a/js/misc/systemActions.js b/js/misc/systemActions.js index 9aeb680ed..7ab200a45 100644 --- a/js/misc/systemActions.js +++ b/js/misc/systemActions.js @@ -188,30 +188,37 @@ const SystemActions = GObject.registerClass({ this._sessionUpdated(); } + // eslint-disable-next-line camelcase get can_power_off() { return this._actions.get(POWER_OFF_ACTION_ID).available; } + // eslint-disable-next-line camelcase get can_suspend() { return this._actions.get(SUSPEND_ACTION_ID).available; } + // eslint-disable-next-line camelcase get can_lock_screen() { return this._actions.get(LOCK_SCREEN_ACTION_ID).available; } + // eslint-disable-next-line camelcase get can_switch_user() { return this._actions.get(SWITCH_USER_ACTION_ID).available; } + // eslint-disable-next-line camelcase get can_logout() { return this._actions.get(LOGOUT_ACTION_ID).available; } + // eslint-disable-next-line camelcase get can_lock_orientation() { return this._actions.get(LOCK_ORIENTATION_ACTION_ID).available; } + // eslint-disable-next-line camelcase get orientation_lock_icon() { return this._actions.get(LOCK_ORIENTATION_ACTION_ID).iconName; } diff --git a/js/perf/core.js b/js/perf/core.js index 0eab47470..314d3ecf5 100644 --- a/js/perf/core.js +++ b/js/perf/core.js @@ -3,6 +3,7 @@ script_applicationsShowStart, script_applicationsShowDone, script_afterShowHide, malloc_usedSize, glx_swapComplete, clutter_stagePaintDone */ +/* eslint camelcase: ["error", { properties: "never", allow: ["^script_", "^malloc", "^glx", "^clutter"] }] */ const System = imports.system; diff --git a/js/perf/hwtest.js b/js/perf/hwtest.js index f4fe64d96..e74ba25ac 100644 --- a/js/perf/hwtest.js +++ b/js/perf/hwtest.js @@ -6,6 +6,7 @@ script_redrawTestDone, script_collectTimings, script_geditLaunch, script_geditFirstFrame, clutter_stagePaintStart, clutter_paintCompletedTimestamp */ +/* eslint camelcase: ["error", { properties: "never", allow: ["^script_", "^clutter"] }] */ const { Clutter, Gio, Shell } = imports.gi; const Main = imports.ui.main; const Scripting = imports.ui.scripting; diff --git a/js/ui/altTab.js b/js/ui/altTab.js index 6ba3ac99f..e4e191a17 100644 --- a/js/ui/altTab.js +++ b/js/ui/altTab.js @@ -662,6 +662,7 @@ class AppIcon extends St.BoxLayout { this.add(this.label, { x_fill: false }); } + // eslint-disable-next-line camelcase set_size(size) { this.icon = this.app.create_icon_texture(size); this._iconBin.child = this.icon; diff --git a/js/ui/layout.js b/js/ui/layout.js index 5a963d756..37dd1ffcc 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -81,10 +81,12 @@ var MonitorConstraint = GObject.registerClass({ this.notify('index'); } + // eslint-disable-next-line camelcase get work_area() { return this._workArea; } + // eslint-disable-next-line camelcase set work_area(v) { if (v == this._workArea) return; diff --git a/js/ui/padOsd.js b/js/ui/padOsd.js index 5f2c85dcd..a900a0116 100644 --- a/js/ui/padOsd.js +++ b/js/ui/padOsd.js @@ -307,10 +307,12 @@ var PadDiagram = GObject.registerClass({ super._init(params); } + // eslint-disable-next-line camelcase get left_handed() { return this._leftHanded; } + // eslint-disable-next-line camelcase set left_handed(leftHanded) { this._leftHanded = leftHanded; } @@ -329,10 +331,12 @@ var PadDiagram = GObject.registerClass({ this._handle = this._composeStyledDiagram(); } + // eslint-disable-next-line camelcase get editor_actor() { return this._editorActor; } + // eslint-disable-next-line camelcase set editor_actor(actor) { actor.hide(); this._editorActor = actor;