FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

build: add cpp linting to windows build by liusy182 · Pull Request #11856 · nodejs/node · GitHub

/ node Public

build: add cpp linting to windows build - #11856

Closed
liusy182 wants to merge 4 commits into
nodejs:masterfrom
liusy182:vcbuild-cpplint
Closed

build: add cpp linting to windows build#11856
liusy182 wants to merge 4 commits into
nodejs:masterfrom
liusy182:vcbuild-cpplint

Conversation

Copy link
Copy Markdown

This PR adds cpp linting to windows build script. After this change,
running command vcbuild lint will run both cpp linting and javascript
linting on a windows machine.

Fixes: #11816

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

This PR adds cpp linting to windows build script. After this change,
running command `vcbuild lint` will run both cpp linting and javascript
linting on a windows machine.

Fixes: nodejs#11816
nodejs-github-bot added build Issues and PRs related to build files or the CI. doc Issues and PRs related to the documentations. labels Mar 15, 2017
mscdex added windows Issues and PRs related to the Windows platform. and removed doc Issues and PRs related to the documentations. labels Mar 15, 2017
Comment thread vcbuild.bat Outdated
%config%\node tools\jslint.js -J -f tap -o test-eslint.tap benchmark lib test tools
goto exit


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Unnecessary whitespace change

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks I will correct this.

jasnell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM with the nit addressed

Copy link
Copy Markdown
Author

I am actually seeing linting failures on my machine when following steps in CONTRIBUTING.md.

More specifically, the failure is regarding header_guard where the full file path is used for comparison. For example, for file "C:\sample\node\src\async-wrap.h", linter is expecting #ifndef SAMPLE_NODE_SRC_ASYNC_WRAP_H_ instead of #ifndef SRC_ASYNC_WRAP_INL_H_. This is because _root is empty on my machine so this statement is not executed.

More of a question, I am wondering if specifying a --root when calling cpplint.py is required. I do not have a Mac at hand so I am not sure how linting could pass on Mac.

Copy link
Copy Markdown
Member

@liusy182 We float a patch (fadf66a) that computes the root from the absolute path to tools/cpplint.py. It probably needs some tweaks for Windows paths.

Copy link
Copy Markdown
Author

thanks @bnoordhuis 👍 I changed file path comparison to use forward slash and it is now running fine.

bnoordhuis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Comment thread tools/cpplint.py Outdated
# XXX(bnoordhuis) Expects that cpplint.py lives in the tools/ directory.
toplevel = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
toplevel = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..')).replace('\\', '/')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Tiniest of nits: can you indent by four spaces?

jasnell pushed a commit that referenced this pull request Mar 17, 2017
This PR adds cpp linting to windows build script. After this change,
running command `vcbuild lint` will run both cpp linting and javascript
linting on a windows machine.

PR-URL: #11856
Fixes: #11816
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

jasnell commented Mar 17, 2017

Copy link
Copy Markdown
Member

Landed in 379eec3.

jasnell closed this Mar 17, 2017

gibfahn commented Mar 17, 2017
edited
Loading

Copy link
Copy Markdown
Member

@liusy182 So at the moment your Git author name and email address are set to:

liusi <siyuan.liu@autodesk.com>

People usually choose to use their full names for commits. To set your name globally (if you want to) you can do:

git config --global user.name "Siyuan Liu"

Just FYI.

Copy link
Copy Markdown
Author

thanks @gibfahn I will change that in future.

gibfahn commented Mar 18, 2017

Copy link
Copy Markdown
Member

@liusy182 also your email address isn't associated with your GitHub account, so you probably want to either change your email address (see below), or add it as an alternative in your GitHub email settings.

git config --global user.email "ss_161091@163.com"

Otherwise you get "Unrecognised author" in the commit log.

italoacasas pushed a commit to italoacasas/node that referenced this pull request Mar 20, 2017
This PR adds cpp linting to windows build script. After this change,
running command `vcbuild lint` will run both cpp linting and javascript
linting on a windows machine.

PR-URL: nodejs#11856
Fixes: nodejs#11816
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
jungx098 pushed a commit to jungx098/node that referenced this pull request Mar 21, 2017
This PR adds cpp linting to windows build script. After this change,
running command `vcbuild lint` will run both cpp linting and javascript
linting on a windows machine.

PR-URL: nodejs#11856
Fixes: nodejs#11816
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>

refack left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Missing documenting new options

Comment thread vcbuild.bat
if /i "%1"=="jslint-ci" set jslint_ci=1&goto arg-ok
if /i "%1"=="lint" set cpplint=1&set jslint=1&goto arg-ok
if /i "%1"=="lint-ci" set cpplint=1&set jslint_ci=1&goto arg-ok
if /i "%1"=="package" set package=1&goto arg-ok

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

No documented in line 420 :(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Addressed in #12278

refack added a commit to refack/node that referenced this pull request Apr 8, 2017
* enable eslint to run even in a "clean" workspace
* small improvement in performance by reducing number of calls to `findstr`
* Document [jslint/jslint-ci] nodejs#11856 (comment)

MylesBorins commented Apr 18, 2017
edited
Loading

Copy link
Copy Markdown
Contributor

should we backport to v6.x?

edit: we should land with #11992 if we do

refack added a commit to refack/node that referenced this pull request Apr 25, 2017
* enable eslint to run even in a "clean" workspace
* small improvement in performance by reducing number of calls to `findstr`
* Document [jslint/jslint-ci] nodejs#11856 (comment)
gibfahn mentioned this pull request Jun 15, 2017
3 tasks
kfarnung pushed a commit to kfarnung/node that referenced this pull request Aug 16, 2017
This PR adds cpp linting to windows build script. After this change,
running command `vcbuild lint` will run both cpp linting and javascript
linting on a windows machine.

PR-URL: nodejs#11856
Fixes: nodejs#11816
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins pushed a commit that referenced this pull request Sep 19, 2017
This PR adds cpp linting to windows build script. After this change,
running command `vcbuild lint` will run both cpp linting and javascript
linting on a windows machine.

Backport-PR-URL: #14879
PR-URL: #11856
Fixes: #11816
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
MylesBorins mentioned this pull request Sep 20, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Issues and PRs related to build files or the CI. windows Issues and PRs related to the Windows platform.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants


Back | FazBrowse Home | New Git URL