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

[JSHINT] enabled on project #1534

Closed
wants to merge 3 commits into from
Closed

[JSHINT] enabled on project #1534

wants to merge 3 commits into from

Conversation

ainthek
Copy link
Contributor

@ainthek ainthek commented Feb 5, 2015

Let's start with default {} .jshintrc and ignore tests for start.

to lint:

npm run lint

coding style #1359

@ainthek
Copy link
Contributor Author

ainthek commented Feb 5, 2015

I have added devDependency to JSHint but build failed: can anyone translate from "travis" to "human" for me? thanx...
https://travis-ci.org/mochajs/mocha/jobs/49659011

@dasilvacontin
Copy link
Contributor

You need to make it install a newer npm version. We had the same issue over at mustache.js: janl/mustache.js#421

{
"laxcomma":true,
"laxbreak":true
}
Copy link
Member

Choose a reason for hiding this comment

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

We'll need to define a proper .jshintrc, but this is fine for now.

@boneskull
Copy link
Member

We need to make this part of the npm test suite, not a separate script.

@boneskull
Copy link
Member

@ainthek To that end, you'll need to modify Makefile and have it run jshint before it executes any tests.

@boneskull
Copy link
Member

Thanks for this!

@ainthek
Copy link
Contributor Author

ainthek commented Feb 5, 2015

Chris, actually I can make this directly in package.json, and script:test can run both lint and the tests.
However I like this to be separated, test is test lint is lint. If you consider lint part of tests please do whatever you want. See: https://github.com/ainthek/node-boilerplate/blob/master/package.json

Decision is really up to you falks....

@boneskull
Copy link
Member

@ainthek What I'd really like is this to happen:

  • new target lint in Makefile:

    lint: 
        npm run-script lint
  • test target changed to:

    test: lint test-all
  • in scripts property of package.json:

    { 
      "test": "make test"
    }

This gives us the ability to run jshint via make or npm run-script, runs all tests by default, and runs the lint before the tests.

If you want to skip the linting and just run the tests, make test-all will be sufficient. If you just want the unit tests, you can make test-unit.

@ainthek
Copy link
Contributor Author

ainthek commented Feb 5, 2015

chris: you have already wrote more lines of the git comments then the actual lines of source code needed to implement this. Why ? I do not get this.

PR is proposal. You have minimal work overhead to adjust it and commit in "adjusted work".
I'm just curious. Why not just making this happen ?

@boneskull
Copy link
Member

@ainthek

Project maintainers ask submitters of PRs to change the code for a couple reasons:

  • Contrary to what you may think, it will take longer for me to apply the change myself than to write this comment.
  • It is considered poor etiquette to take a PR and put your name on it, which would be what I would be doing if I just made the changes myself.

So, if you are not willing to make the changes, we'll close the issue, make a note in #1359, and someone will get to it eventually. However, I'd like to merge your changes in (with modifications), so I'm asking if you would please change the code and squash your commits.

Thanks!

@dasilvacontin
Copy link
Contributor

We actually have an issue discussing that we want to enforce the code style, because it is currently a mess. And it is both easier and faster to make lint be a part of the test routine rather than having to review the PR, ask for code style changes, wait for style changes, review PR again, etc.

@ainthek
Copy link
Contributor Author

ainthek commented Feb 6, 2015

Will squash and send again.

@ainthek ainthek closed this Feb 6, 2015
@ainthek ainthek deleted the jshint-enabled branch February 6, 2015 07:28
@dasilvacontin
Copy link
Contributor

@ainthek ?

@ainthek
Copy link
Contributor Author

ainthek commented Feb 9, 2015

I will work on more complete fix and then make pull request.
Also will try to run travis on my repo first to avoid "bad pull requests".

Will make PR then.

ndhoule added a commit to ndhoule/mocha that referenced this pull request Jun 30, 2015
Follows @boneskull's `make test` suggestion in
mochajs#1534 (comment)
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.

None yet

3 participants