Commit Graph

26 Commits

Author SHA1 Message Date
Florian Müllner
b446667df6 cleanup: Disambiguate assignments in arrow functions
As arrow functions have an implicit return value, an assignment of
this.foo = bar could have been intended as a this.foo === bar
comparison. To catch those errors, we will disallow these kinds
of assignments unless they are marked explicitly by an extra pair
of parentheses.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/731
2019-09-15 16:02:45 +02:00
Florian Müllner
5b3935fa43 cleanup: Fix up "special" comments
Our coding style asks for a space after the comment start, which
some of our ASCII-artsy comments violate. Adjust them to fit the
rule, or remove them altogether.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/731
2019-09-15 16:02:45 +02:00
Florian Müllner
93a461f3f7 perf: Shut up another eslint error
The functions here are asynchronous to handle control back to the
mainloop while waiting for an action to complete, not to run operations
in parallel. That is, the race condition the rule is protecting against
isn't an issue here, so disable the error.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
fda7c9b06e perf: Shut up an eslint error
The while(true) loop is intentional here and not a bug, so disable
the corresponding eslint rule.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
1e13f32cea 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
2019-07-24 00:28:45 +02:00
Florian Müllner
e357559582 cleanup: Mark globals used from other modules as exported
eslint cannot figure out that those symbols are used from other modules
via imports, so they trigger unused-variable errors. To fix, explicitly
mark those symbols as exported.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
71759a0769 cleanup: Mark unused (but useful) variables as ignored
While we aren't using those destructured variables, they are still useful
to document the meaning of those elements. We don't want eslint to keep
warning about them though, so mark them accordingly.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
2f97a1a55d cleanup: Mark unused arguments as unused
This will stop eslint from warning about them, while keeping their
self-documenting benefit.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
79cf3a6dd0 cleanup: Remove some unhelpful unused arguments
Those unused arguments aren't bugs - unbeknownst to eslint, they all
correspond to valid signal parameters - but they don't contribute
anything to clarity, so just remove them anyway.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
0d035a4e53 cleanup: Prefer template strings
Template strings are much nicer than string concatenation, so use
them where possible; this excludes translatable strings and any
strings containing '/' (until we can depend on gettext >= 0.20[0]).

[0] https://savannah.gnu.org/bugs/?50920

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/612
2019-07-05 11:32:31 +00:00
Florian Müllner
14d7897a93 style: Stop using braces for single-line arrow functions
Braces are optional for single-line arrow functions, but there's a
subtle difference:
Without braces, the expression is implicitly used as return value; with
braces, the function returns nothing unless there's an explicit return.

We currently reflect that in our style by only omitting braces when the
function is expected to have a return value, but that's not very obvious,
not an important differentiation to make, and not easy to express in an
automatic rule.

So just omit braces consistently as mandated by gjs' coding style.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/608
2019-07-02 12:17:46 +00:00
Florian Müllner
7ac35c644e style: Fix stray/missing spaces
Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607
2019-07-01 23:44:11 +02:00
Florian Müllner
29b04fcbf2 style: Fix stray/missing semi-colons
Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607
2019-07-01 23:44:11 +02:00
Florian Müllner
4541fb9819 perf: Stop using GTK
Instead of going through GtkSettings, we can just as well use the
underlying GSettings directly.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/481
2019-04-11 17:27:50 +00:00
Florian Müllner
32baff5906 perf: Use var for METRICS
Each perf module exposes it to the scripting module to report metrics
after all tests have been run. The symbol's scope should allow that,
so declare it as var.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/440
2019-03-21 10:18:02 +00:00
Florian Müllner
fd50b9a45e cleanup: Use destructuring for imports from GI
This is *much* nicer than repetitive "imports.gi" lines ...

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/399
2019-02-09 07:39:20 +01:00
Florian Müllner
a1534dab02 cleanup: Clean up unused imports
Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/399
2019-02-09 05:05:07 +01:00
Florian Müllner
46575804cc perf: Stop using legacy generator functions
This was a non-standard Mozilla extension that is no longer supported.
Simply switch to the standardized generator syntax to fix.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/367
2019-01-28 17:29:35 +00:00
Yussuf Khalil
581b38ecf4 scripting: Fix argument list of createTestWindow()
Commit f285f2c6 changed Scripting.createTestWindow() to accept a parameter
object instead of a parameter list but forgot to remove the width and height
arguments. This breaks the "core" test as all windows are created with default
settings.
2018-04-25 23:47:06 +02:00
Florian Müllner
213e38c2ef cleanup: Use arrow notation for anonymous functions
Arrow notation is great, use it consistently through-out the code base
to bind `this` to anonymous functions, replacing the more overbose
Lang.bind(this, function() {}).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
2018-02-21 13:55:00 +00:00
Owen W. Taylor
73977795a6 Revert accidental commit "Test stuff"
This reverts commit 3b3445146d.
2014-09-03 13:47:18 -04:00
Owen W. Taylor
3b3445146d Test stuff 2014-09-03 13:45:01 -04:00
Owen W. Taylor
28cc0da151 hwtest.js: Fix median computation
By default Array.prototype.sort() sorts all values by converting
them to strings, even numbers!
2014-08-10 09:25:10 +02:00
Owen W. Taylor
916c02a2f5 hwtest: Handle rename of gedit desktop file
It's now org.gnome.gedit.desktop not gedit.desktop.
2014-07-25 10:40:45 +02:00
Owen W. Taylor
46c86e093c hwtest.js: Don't parse JSON with regexps
Use JSON.parse() to parse systemd log records, rather than using
regexps.

https://bugzilla.gnome.org/show_bug.cgi?id=732350
2014-07-16 13:22:13 -04:00
Owen W. Taylor
4e56af39da Add a new hwtest script
Add a performance test script that is used by the GNOME Hardware Testing
Project to measure metrics to be reported to perf.gnome.org.

https://bugzilla.gnome.org/show_bug.cgi?id=732350
2014-07-16 10:37:48 -04:00