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

npm run test fails on windows #435

Open
bessorion opened this issue May 2, 2018 · 5 comments
Open

npm run test fails on windows #435

bessorion opened this issue May 2, 2018 · 5 comments
Labels

Comments

@bessorion
Copy link
Contributor

I tried to run tests on Win 10, nvm 8.11.1:
C:\Users\BeSSoRioN\Documents\GitHub\qmlweb>npm run test

Result output you can see below. remark command return exit status 1 because of warnings, so test procedure fails on remark -qf *.md docs:

> qmlweb@0.2.0 test C:\Users\BeSSoRioN\Documents\GitHub\qmlweb
> npm run lint && gulp test

> qmlweb@0.2.0 lint C:\Users\BeSSoRioN\Documents\GitHub\qmlweb
> npm run eslint && npm run mdlint

> qmlweb@0.2.0 eslint C:\Users\BeSSoRioN\Documents\GitHub\qmlweb
> eslint --cache *.js src tests builder

> qmlweb@0.2.0 mdlint C:\Users\BeSSoRioN\Documents\GitHub\qmlweb
> remark -qf *.md docs

CONTRIBUTING.md
43:82 warning Line must be at most 80 characters maximum-line-length remark-lint
45:82 warning Line must be at most 80 characters maximum-line-length remark-lint
93:82 warning Line must be at most 80 characters maximum-line-length remark-lint
123:82 warning Line must be at most 80 characters maximum-line-length remark-lint
124:82 warning Line must be at most 80 characters maximum-line-length remark-lint
142:82 warning Line must be at most 80 characters maximum-line-length remark-lint
237:82 warning Line must be at most 80 characters maximum-line-length remark-lint
245:82 warning Line must be at most 80 characters maximum-line-length remark-lint

README.md
40:82 warning Line must be at most 80 characters maximum-line-length remark-lint
143:82 warning Line must be at most 80 characters maximum-line-length remark-lint
154:82 warning Line must be at most 80 characters maximum-line-length remark-lint

docs\QMLEngine.md
69:82 warning Line must be at most 80 characters maximum-line-length remark-lint
118:82 warning Line must be at most 80 characters maximum-line-length remark-lint

docs\Signal.md
32:82 warning Line must be at most 80 characters maximum-line-length remark-lint

‼ 14 warnings
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! qmlweb@0.2.0 mdlint: 'remark -qf *.md docs && exit 0'
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the qmlweb@0.2.0 mdlint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\BeSSoRioN\AppData\Roaming\npm-cache\_logs\2018-05-02T22_53_04_267Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! qmlweb@0.2.0 lint: 'npm run eslint && npm run mdlint'
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the qmlweb@0.2.0 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\BeSSoRioN\AppData\Roaming\npm-cache\_logs\2018-05-02T22_53_04_329Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! qmlweb@0.2.0 test: 'npm run lint && gulp test'
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the qmlweb@0.2.0 test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\BeSSoRioN\AppData\Roaming\npm-cache\_logs\2018-05-02T22_53_04_384Z-debug.log

After *.md files had been changed to resolve warnings the whole test finished successfully.

@bessorion
Copy link
Contributor Author

I suppose it's because of encoding. Warning valid for 80-character lines (because of line-ending?)
Also some windows editors visualize symbols « » and — in wrong way, but it's not so critical.

@bessorion
Copy link
Contributor Author

bessorion commented May 3, 2018

./node_modules/remark-lint/lib/rules/maximum-line-length.js

function maximumLineLength(ast, file, preferred) {
var style = preferred && preferred !== true ? preferred : 80;
var content = file.toString();
var matrix = content.split('\n');
var index = -1;
var length = matrix.length;
var lineLength;

And I see via Hex-editor 0D0A line endings in my local files.

@ChALkeR
Copy link
Member

ChALkeR commented May 3, 2018

@bessorion Yeah, that makes sense, thanks!
Looks like a remark-lint bug.

Will try to update to the latest version (that requires changes on QmlWeb side, see #412), if that won't fix things — will take a look at remark side.

@ChALkeR ChALkeR added the tests label May 3, 2018
@bessorion
Copy link
Contributor Author

bessorion commented May 3, 2018

I think migration to 6.0.0 should solve problem:
https://github.com/remarkjs/remark-lint/blob/master/packages/remark-lint-maximum-line-length/index.js

function maximumLineLength(ast, file, preferred) {
  var style = preferred && preferred !== true ? preferred : 80;
  var content = file.toString();
  var matrix = content.split(/\r?\n/);

@Plaristote
Copy link
Member

We migrated remark-lint to 9.1.0 (time flies, doesn't it) ! I assume the issue has been resolved ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants