Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Add jscs rules #9792

Closed
wants to merge 10 commits into from
Closed

Add jscs rules #9792

wants to merge 10 commits into from

Conversation

hzoo
Copy link
Contributor

@hzoo hzoo commented Oct 25, 2014

WIP

Maybe we just exclude ngLocale/ from style check because they are generated anyway?

Cc: @caitp

@caitp
Copy link
Contributor

caitp commented Oct 25, 2014

If you want to exclude ngLocale from jscs checks, I think that's okay --- but we definitely want to jshint it.

@hzoo
Copy link
Contributor Author

hzoo commented Oct 26, 2014

What do you think about the other rules?
Do you think I should add another commit to the PR to exclude it or replace the last commit that changed all the locale files?

@caitp
Copy link
Contributor

caitp commented Oct 26, 2014

I'm not a fan of all of the changes --- most of it's fine.

One thing though, I think we should move jscs linting until after the tests run for the unit test job. I care a lot more about stuff working right than I care about it matching the style rules, which can usually be easily fixed during check-in.

@hzoo
Copy link
Contributor Author

hzoo commented Oct 26, 2014

Yeah styles are just nice to have. So you mean changing the Gruntfile so
grunt.registerTask('test', 'Run unit, docs and e2e tests with Karma', ['jshint', 'jscs', 'package','test:unit','test:promises-aplus', 'tests:docs', 'test:protractor']);
becomes
grunt.registerTask('test', 'Run unit, docs and e2e tests with Karma', ['jshint', 'package','test:unit','jscs','test:promises-aplus', 'tests:docs', 'test:protractor']);

or moving it to the very end?

@caitp
Copy link
Contributor

caitp commented Oct 26, 2014

No, nothing in the grunt file, in the travis build script: https://github.com/angular/angular.js/blob/master/scripts/travis/build.sh#L8

We should move that to the last job, or maybe pre-docsapp tests

@hzoo
Copy link
Contributor Author

hzoo commented Oct 26, 2014

Ok removed the other rule, reordered the tasks, excluded src/ngLocale from jscs check.

@hzoo hzoo force-pushed the add-jscs-rules branch 2 times, most recently from 33f1ca0 to 81d1968 Compare October 26, 2014 02:19
@hzoo
Copy link
Contributor Author

hzoo commented Oct 26, 2014

I also noticed in the .editorconfig:

[src/ngLocale/**]
insert_final_newline = false

From #8278,
I removed the final newline requirement from src/ngLocale files because all of the 446 files in that directory are missing a final newline. I assume these are generated by a script/program that leaves out the final newline.

So I guess we can remove that if since the script add's the new line.

@caitp
Copy link
Contributor

caitp commented Oct 27, 2014

I feel like @IgorMinar should have some input on merging more of these style rules, otherwise I'm just injecting my own opinion into it. It works for me, so if it's cool with googlers I guess it can land

@hzoo
Copy link
Contributor Author

hzoo commented Oct 27, 2014

Yeah and probably a look at the previous changes that weren't in the .jscs.json.todo

@IgorMinar
Copy link
Contributor

alright. I don't see any red flags here. @caitp can you get this in please?

@IgorMinar IgorMinar added this to the 1.3.1 milestone Oct 31, 2014
@IgorMinar IgorMinar assigned IgorMinar and caitp and unassigned IgorMinar Oct 31, 2014
@caitp caitp closed this in 030101a Oct 31, 2014
@hzoo
Copy link
Contributor Author

hzoo commented Oct 31, 2014

Nice thanks!

@caitp
Copy link
Contributor

caitp commented Oct 31, 2014

✨ 👏 ✨

@hzoo hzoo deleted the add-jscs-rules branch November 1, 2014 02:06
Narretz added a commit to Narretz/angular.js that referenced this pull request Dec 11, 2015
This was changed as part of angular#9792.
While the logic is sound that style errors shouldn't block tests from
running, ddescribe should run before the tests.
Otherwise, when Travis exits with a warning after some browsers have run,
ddescribe doesn't get run and it doesn't immediately become apparent
that not all tests have run.
Narretz added a commit to Narretz/angular.js that referenced this pull request Dec 14, 2015
Now, before the tests run, ddescribe and jshint will run. After the
tests, jscs will run. Merge conflicts should be caught by jshint, that's
why this task has been removed.

The order was orginally changed as part of angular#9792.
While the logic is sound that style errors shouldn't block tests from
running, ddescribe should run before the tests.
Otherwise, when Travis exits with a warning after some browsers have run,
ddescribe doesn't get run and it doesn't immediately become apparent
that not all tests have run.
Narretz added a commit to Narretz/angular.js that referenced this pull request Dec 14, 2015
Now, before the tests run, ddescribe and jshint will run. After the
tests, jscs will run. Merge conflicts should be caught by jshint, that's
why this task has been removed.

The order was orginally changed as part of angular#9792.
While the logic is sound that style errors shouldn't block tests from
running, ddescribe should run before the tests.
Otherwise, when Travis exits with a warning after some browsers have run,
ddescribe doesn't get run and it doesn't immediately become apparent
that not all tests have run.
Narretz added a commit to Narretz/angular.js that referenced this pull request Dec 14, 2015
Now, before the tests run, ddescribe and jshint will run. After the
tests, jscs will run. Merge conflicts should be caught by jshint, that's
why this task has been removed.

The order was orginally changed as part of angular#9792.
While the logic is sound that style errors shouldn't block tests from
running, ddescribe should run before the tests.
Otherwise, when Travis exits with a warning after some browsers have run,
ddescribe doesn't get run and it doesn't immediately become apparent
that not all tests have run.
Narretz added a commit to Narretz/angular.js that referenced this pull request Dec 15, 2015
…e tests

Now, before the tests run, ddescribe, merge-conflicts, and jshint will
run. After the tests, jscs will run.

The order was orginally changed as part of angular#9792.
While the logic is sound that style errors shouldn't block tests from
running, ddescribe should run before the tests.
Otherwise, when Travis exits with a warning after some browsers have run,
ddescribe doesn't get run and it doesn't immediately become apparent
that not all tests have run.
Narretz added a commit to Narretz/angular.js that referenced this pull request Dec 15, 2015
…e tests

Now, before the tests run, ddescribe, merge-conflicts, and jshint will
run. After the tests, jscs will run.

The order was orginally changed as part of angular#9792.
While the logic is sound that style errors shouldn't block tests from
running, ddescribe should run before the tests.
Otherwise, when Travis exits with a warning after some browsers have run,
ddescribe doesn't get run and it doesn't immediately become apparent
that not all tests have run.
Narretz added a commit to Narretz/angular.js that referenced this pull request Dec 15, 2015
…e tests

Now, before the tests run, ddescribe, merge-conflicts, and jshint will
run. After the tests, jscs will run.

The order was orginally changed as part of angular#9792.
While the logic is sound that style errors shouldn't block tests from
running, ddescribe should run before the tests.
Otherwise, when Travis exits with a warning after some browsers have run,
ddescribe doesn't get run and it doesn't immediately become apparent
that not all tests have run.
Narretz added a commit to Narretz/angular.js that referenced this pull request Dec 15, 2015
Previously, ddescribe, merge-conflicts, jshint, and jscs would run
after unit & e2e tests ran. The order was orginally changed as part of
angular#9792.

While the logic is sound that style errors shouldn't block tests from
running, ddescribe should always run. This was not guaraneteed; when
Travis exits with a warning after some browsers have run, ddescribe
doesn't get run and it doesn't become apparent that not
all tests have run.

Additionally, a separate job clearly separates style from test errors,
which e.g. means you can open a PR that includes an iit to speed up
the job, and see immediately if the test passes, because the ddescribe
error is in another job.
Narretz added a commit that referenced this pull request Dec 16, 2015
Previously, ddescribe, merge-conflicts, jshint, and jscs would run
after unit & e2e tests ran. The order was orginally changed as part of
#9792.

While the logic is sound that style errors shouldn't block tests from
running, ddescribe should always run. This was not guaraneteed; when
Travis exits with a warning after some browsers have run, ddescribe
doesn't get run and it doesn't become apparent that not
all tests have run.

Additionally, a separate job clearly separates style from test errors,
which e.g. means you can open a PR that includes an iit to speed up
the job, and see immediately if the test passes, because the ddescribe
error is in another job.
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this pull request Dec 16, 2015
Previously, ddescribe, merge-conflicts, jshint, and jscs would run
after unit & e2e tests ran. The order was orginally changed as part of
angular#9792.

While the logic is sound that style errors shouldn't block tests from
running, ddescribe should always run. This was not guaraneteed; when
Travis exits with a warning after some browsers have run, ddescribe
doesn't get run and it doesn't become apparent that not
all tests have run.

Additionally, a separate job clearly separates style from test errors,
which e.g. means you can open a PR that includes an iit to speed up
the job, and see immediately if the test passes, because the ddescribe
error is in another job.
petebacondarwin pushed a commit to petebacondarwin/angular.js that referenced this pull request Dec 16, 2015
Previously, ddescribe, merge-conflicts, jshint, and jscs would run
after unit & e2e tests ran. The order was orginally changed as part of
angular#9792.

While the logic is sound that style errors shouldn't block tests from
running, ddescribe should always run. This was not guaraneteed; when
Travis exits with a warning after some browsers have run, ddescribe
doesn't get run and it doesn't become apparent that not
all tests have run.

Additionally, a separate job clearly separates style from test errors,
which e.g. means you can open a PR that includes an iit to speed up
the job, and see immediately if the test passes, because the ddescribe
error is in another job.
Narretz added a commit that referenced this pull request Dec 16, 2015
Previously, ddescribe, merge-conflicts, jshint, and jscs would run
after unit & e2e tests ran. The order was orginally changed as part of
#9792.

While the logic is sound that style errors shouldn't block tests from
running, ddescribe should always run. This was not guaraneteed; when
Travis exits with a warning after some browsers have run, ddescribe
doesn't get run and it doesn't become apparent that not
all tests have run.

Additionally, a separate job clearly separates style from test errors,
which e.g. means you can open a PR that includes an iit to speed up
the job, and see immediately if the test passes, because the ddescribe
error is in another job.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants