Skip to content

Commit

Permalink
Turn on prettier (except repo root) (#1167)
Browse files Browse the repository at this point in the history
* Use prettier-check
* Update semi option
    See discussion #948 (comment)
* Developer documentation
* Run the same steps in both `main` jobs
* Move integration tests from `danger` to `main` where they belong
  • Loading branch information
paulmelnikow authored Aug 8, 2018
1 parent ff15e9b commit ab051b3
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 79 deletions.
39 changes: 27 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,15 @@ jobs:
when: always
command: npm run test:js:server

danger:
docker:
- image: shieldsio/shields-ci-node-8:0.0.3
working_directory: ~/repo
steps:
- checkout

- restore_cache:
key: v1-dependencies-{{ checksum "package.json" }}

- run:
name: Integration tests
when: always
command: npm run test:integration

- run:
name: Danger
name: 'Prettier check (quick fix: `npm run prettier`)'
when: always
command: npm run danger ci
command: npm run prettier-check

main@node-latest:
docker:
Expand All @@ -83,6 +73,31 @@ jobs:
when: always
command: npm run test:js:server

- run:
name: Integration tests
when: always
command: npm run test:integration

- run:
name: 'Prettier check (quick fix: `npm run prettier`)'
when: always
command: npm run prettier-check

danger:
docker:
- image: shieldsio/shields-ci-node-8:0.0.3
working_directory: ~/repo
steps:
- checkout

- restore_cache:
key: v1-dependencies-{{ checksum "package.json" }}

- run:
name: Danger
when: always
command: npm run danger ci

frontend:
docker:
- image: shieldsio/shields-ci-node-8:0.0.3
Expand Down
3 changes: 0 additions & 3 deletions .eslintrc-preferred.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
plugins:
# - "prettier"
- "chai-friendly"

extends:
Expand All @@ -12,8 +11,6 @@ parserOptions:
sourceType: "script"

rules:
# prettier/prettier: "error"

# These are not disabled by eslint-config-prettier
spaced-comment: "off"
standard/object-curly-even-spacing: "off"
Expand Down
7 changes: 7 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
server.js
dangerfile.js
next.config.js
server.spec.js
package.json
package-lock.json
/__snapshots__
/.next
/build
/coverage
1 change: 1 addition & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
semi: false
singleQuote: true
trailingComma: es5
bracketSpacing: true
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ Badge URLs
Coding guidelines
-----------------

### Prettier

This project formats its source code using Prettier. The most enjoyable way to
use Prettier is to let is format code for you when you save. You can [integrate
it into your editor][integrate prettier].

If for whatever reason you don't want to do that, you can run
`npm run prettier` to format the code from the command line.

[integrate prettier]: https://prettier.io/docs/en/editors.html

### Tests

When adding or changing a service [please write tests][service-tests].
Expand Down
Loading

0 comments on commit ab051b3

Please sign in to comment.