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

require-buffer lint fixer #17144

Closed
wants to merge 5 commits into from
Closed

Conversation

Bamieh
Copy link
Contributor

@Bamieh Bamieh commented Nov 20, 2017

Partially Fixes #16636 (adds the require-buffer lint fixer).

If the buffer module is not required while Buffer is used, require the buffer module as follows:

const { Buffer } = require('buffer');
  • If the file has a 'use strict'; line, add the require after it on a separate line.
  • If the file does not have any (currently impossible with the strict rule) add it after the first comment and before the real code starts.
Checklist
Affected core subsystem(s)

tools

Adds `require-buffer` lint fixer.
If the buffer module is not required while `Buffer` is used, require the `buffer` module.
If the file has a `'use strict';` line, add the require after it on a separate line.
If the file does not have any (currently impossible with the `strict` rule) add it after the first comment (before the real code starts).
@nodejs-github-bot nodejs-github-bot added the tools Issues and PRs related to the tools directory. label Nov 20, 2017
@Bamieh Bamieh changed the title Fixes: https://github.com/nodejs/node/issues/16636 require-buffer lint fixer Nov 20, 2017
@targos
Copy link
Member

targos commented Nov 23, 2017

@Bamieh
Copy link
Contributor Author

Bamieh commented Nov 23, 2017

hmm 🤔 i ran the tests on my machine (macOS) and everything is working fine, anyone with freebsd experience can tell why its failing on that OS?


Update:

After looking into the jenkins error logs

Checking ^not ok
/home/iojs/build/workspace/node-test-commit-freebsd/nodes/freebsd10-64/test.tap:
not ok 2078 sequential/test-net-localport

This does not seem an error caused from the code i've written

@Bamieh
Copy link
Contributor Author

Bamieh commented Nov 25, 2017

@targos can we rerun the tests?

@targos
Copy link
Member

targos commented Nov 25, 2017

@Bamieh
Copy link
Contributor Author

Bamieh commented Nov 25, 2017

linux-fips20 fails now, i'm concerned about the stability of those tests. Can someone confirm?

11:08:15 Makefile:338: recipe for target 'test/addons-napi/.buildstamp' failed
...
11:08:19 mv: cannot stat 'test.tap': No such file or directory

@addaleax addaleax added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. and removed author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Nov 28, 2017
@addaleax
Copy link
Member

Landed in 0319a5e

@addaleax addaleax closed this Nov 28, 2017
addaleax pushed a commit that referenced this pull request Nov 28, 2017
Adds `require-buffer` lint fixer.
If the buffer module is not required while `Buffer` is used, require the `buffer` module.
If the file has a `'use strict';` line, add the require after it on a separate line.
If the file does not have any (currently impossible with the `strict` rule) add it after the first comment (before the real code starts).

Fixes: #16636
PR-URL: #17144
Reviewed-By: Michaël Zasso <targos@protonmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
Adds `require-buffer` lint fixer.
If the buffer module is not required while `Buffer` is used, require the `buffer` module.
If the file has a `'use strict';` line, add the require after it on a separate line.
If the file does not have any (currently impossible with the `strict` rule) add it after the first comment (before the real code starts).

Fixes: #16636
PR-URL: #17144
Reviewed-By: Michaël Zasso <targos@protonmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
Adds `require-buffer` lint fixer.
If the buffer module is not required while `Buffer` is used, require the `buffer` module.
If the file has a `'use strict';` line, add the require after it on a separate line.
If the file does not have any (currently impossible with the `strict` rule) add it after the first comment (before the real code starts).

Fixes: #16636
PR-URL: #17144
Reviewed-By: Michaël Zasso <targos@protonmail.com>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
Adds `require-buffer` lint fixer.
If the buffer module is not required while `Buffer` is used, require the `buffer` module.
If the file has a `'use strict';` line, add the require after it on a separate line.
If the file does not have any (currently impossible with the `strict` rule) add it after the first comment (before the real code starts).

Fixes: #16636
PR-URL: #17144
Reviewed-By: Michaël Zasso <targos@protonmail.com>
@MylesBorins MylesBorins mentioned this pull request Dec 12, 2017
gibfahn pushed a commit that referenced this pull request Dec 19, 2017
Adds `require-buffer` lint fixer.
If the buffer module is not required while `Buffer` is used, require the `buffer` module.
If the file has a `'use strict';` line, add the require after it on a separate line.
If the file does not have any (currently impossible with the `strict` rule) add it after the first comment (before the real code starts).

Fixes: #16636
PR-URL: #17144
Reviewed-By: Michaël Zasso <targos@protonmail.com>
@gibfahn gibfahn mentioned this pull request Dec 20, 2017
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
Adds `require-buffer` lint fixer.
If the buffer module is not required while `Buffer` is used, require the `buffer` module.
If the file has a `'use strict';` line, add the require after it on a separate line.
If the file does not have any (currently impossible with the `strict` rule) add it after the first comment (before the real code starts).

Fixes: #16636
PR-URL: #17144
Reviewed-By: Michaël Zasso <targos@protonmail.com>
@gibfahn gibfahn mentioned this pull request Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement automatic fixes for our custom eslint rules
5 participants