Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup JUnit reporter based on suggestions from ESLint #154

Closed

Conversation

astorije
Copy link
Contributor

I know you aren't using ESLint, but as we were monkey-patching this file and I linted it on our end, I figured I should send these your way.
I tried to remove the opinionated/stylistic ones and only keep those who do improve the code.

These fix the following:

2:1   error  Move the invocation into the parens that contain the function  wrap-iife
35:29  error  Unnecessary escape character: \&                               no-useless-escape
37:23  error  Unnecessary escape character: \>                               no-useless-escape
38:23  error  Unnecessary escape character: \"                               no-useless-escape
39:23  error  Unnecessary escape character: \'                               no-useless-escape
54:5   error  Expected line before comment                                   lines-around-comment
60:12  error  Unary word operator 'typeof' must be followed by whitespace    space-unary-ops
60:18  error  Gratuitous parentheses around expression                       no-extra-parens
63:36  error  Move the invocation into the parens that contain the function  wrap-iife
73:27  error  Move the invocation into the parens that contain the function  wrap-iife
182:24  error  Unary word operator 'typeof' must be followed by whitespace    space-unary-ops
182:30  error  Gratuitous parentheses around expression                       no-extra-parens
183:31  error  Unary word operator 'typeof' must be followed by whitespace    space-unary-ops
183:37  error  Gratuitous parentheses around expression                       no-extra-parens
197:49  error  'specName' is defined but never used                           no-unused-vars
212:13  error  'totalSpecsExecuted' is defined but never used                 no-unused-vars
213:13  error  'totalSpecsDefined' is defined but never used                  no-unused-vars
230:40  error  'summary' is defined but never used                          no-unused-vars
234:73  error  'encoding' is defined but never used                         no-unused-vars
480:38  error  Gratuitous parentheses around expression                       no-extra-parens
236:83  error  'fd' is defined but never used                                 no-unused-vars
316:20  error  Unnecessary 'else' after 'return'                              no-else-return
366:1   error  Trailing spaces not allowed                                    no-trailing-spaces
394:20  error  Unnecessary 'else' after 'return'                              no-else-return
428:1   error  Trailing spaces not allowed                                    no-trailing-spaces

These fix the following:

```
2:1   error  Move the invocation into the parens that contain the function  wrap-iife
35:29  error  Unnecessary escape character: \&                               no-useless-escape
37:23  error  Unnecessary escape character: \>                               no-useless-escape
38:23  error  Unnecessary escape character: \"                               no-useless-escape
39:23  error  Unnecessary escape character: \'                               no-useless-escape
54:5   error  Expected line before comment                                   lines-around-comment
60:12  error  Unary word operator 'typeof' must be followed by whitespace    space-unary-ops
60:18  error  Gratuitous parentheses around expression                       no-extra-parens
63:36  error  Move the invocation into the parens that contain the function  wrap-iife
73:27  error  Move the invocation into the parens that contain the function  wrap-iife
182:24  error  Unary word operator 'typeof' must be followed by whitespace    space-unary-ops
182:30  error  Gratuitous parentheses around expression                       no-extra-parens
183:31  error  Unary word operator 'typeof' must be followed by whitespace    space-unary-ops
183:37  error  Gratuitous parentheses around expression                       no-extra-parens
197:49  error  'specName' is defined but never used                           no-unused-vars
212:13  error  'totalSpecsExecuted' is defined but never used                 no-unused-vars
213:13  error  'totalSpecsDefined' is defined but never used                  no-unused-vars
230:40  error  'summary' is defined but never used                          no-unused-vars
234:73  error  'encoding' is defined but never used                         no-unused-vars
480:38  error  Gratuitous parentheses around expression                       no-extra-parens
236:83  error  'fd' is defined but never used                                 no-unused-vars
316:20  error  Unnecessary 'else' after 'return'                              no-else-return
366:1   error  Trailing spaces not allowed                                    no-trailing-spaces
394:20  error  Unnecessary 'else' after 'return'                              no-else-return
428:1   error  Trailing spaces not allowed                                    no-trailing-spaces
```
@astorije
Copy link
Contributor Author

astorije commented Aug 8, 2017

Hey folks, are you any interested by this PR? :)

@putermancer
Copy link
Collaborator

I'd happily merge this PR if the same changes were applied to the rest of the reporter files. As it is now, it only cleans up the junit reporter, but several of the same items exist in nunit and others. While I like cleanliness and things that pass linters, in this case I prefer things that are consistent within the repo. So if you want to update the PR with similar cleanup for the rest of the reporter files, I'm happy to merge.

Copy link
Collaborator

@putermancer putermancer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to merge this if all the reporter files are updated similarly, but would rather keep them consistent than change one to use new patterns in isolation.

@astorije
Copy link
Contributor Author

Hey @bloveridge! This PR is quite outdated with a bunch of conflicts, so I'll do so in a new PR for history sake.

@astorije astorije closed this Nov 26, 2017
@astorije astorije deleted the astorije/cleanup-junit-reporter branch November 26, 2017 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants