Enable no-shadow rule for eslint for xpcshell mochitests

RESOLVED FIXED in Firefox 52

Status

()

defect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: jaws, Assigned: jaws)

Tracking

(Blocks 1 bug)

unspecified
Firefox 52
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox52 fixed)

Details

Attachments

(1 attachment)

+++ This bug was initially created as a clone of Bug #1314474 +++

Enabling the no-shadow rule for all of m-c has thousands of errors, so this approach is to fix the no-shadow rule piecemeal.

The attached patch fixes the no-shadow rule for xpcshell tests. Bug 1314474 fixed them for mochitests.
No longer depends on: 1314474

Comment 3

3 years ago
mozreview-review
Comment on attachment 8808482 [details]
Bug 1315781 - Enable no-shadow rule for eslint for xpcshell mochitests.

https://reviewboard.mozilla.org/r/91312/#review91418

Thanks for doing this!
I noticed some nits while skimming the PSM changes...

::: security/manager/ssl/tests/unit/test_cert_keyUsage.js:53
(Diff revision 1)
>      addCertFromFile(certdb, "test_cert_keyUsage/" + ca + ".pem", "CTu,CTu,CTu");
> -    let cert = constructCertFromFile("test_cert_keyUsage/" + ca + ".pem");
> -    yield asyncTestCertificateUsages(certdb, cert, expectedUsagesMap[ca]);
> +    let caCert = constructCertFromFile("test_cert_keyUsage/" + ca + ".pem");
> +    yield asyncTestCertificateUsages(certdb, caCert, expectedUsagesMap[ca]);
>      for (let ee of eeList) {
>        let eeFullName = ee + "-" + ca;
> -      let cert = constructCertFromFile("test_cert_keyUsage/" + eeFullName + ".pem");
> +      let fullNameCert = constructCertFromFile("test_cert_keyUsage/" + eeFullName + ".pem");

Nit: `eeCert` would be a better name for this.

::: security/manager/ssl/tests/unit/test_weak_crypto.js:126
(Diff revision 1)
>        }
>      },
>  
> -    onInputStreamReady: function(input) {
> +    onInputStreamReady: function(streamReadyInput) {
>        try {
> -        let data = NetUtil.readInputStreamToString(input, input.available());
> +        let data = NetUtil.readInputStreamToString(streamReadyInput, streamReadyInput.available());

Nit: PSM code generally tries to stick to max 80 chars or so per line.

Comment 4

3 years ago
mozreview-review
Comment on attachment 8808482 [details]
Bug 1315781 - Enable no-shadow rule for eslint for xpcshell mochitests.

https://reviewboard.mozilla.org/r/91312/#review91754
Attachment #8808482 - Flags: review?(dtownsend) → review+
Comment hidden (mozreview-request)

Comment 6

3 years ago
Pushed by jwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f6f28be8d8f2
Enable no-shadow rule for eslint for xpcshell mochitests. r=mossop
Sorry had to back out for XPCShell test timed out, i.e., https://treeherder.mozilla.org/logviewer.html#?job_id=6434418&repo=autoland#L10351
Flags: needinfo?(jaws)

Comment 8

3 years ago
Backout by ihsiao@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/577d70d19512
Backed out changeset f6f28be8d8f2 for XPCShell test timed out
Comment hidden (mozreview-request)

Comment 11

3 years ago
Pushed by jwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f3491aaeac27
Enable no-shadow rule for eslint for xpcshell mochitests. r=mossop

Comment 12

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/f3491aaeac27
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
You need to log in before you can comment on or make changes to this bug.