Skip to content

Commit 830c356

Browse files
Merge pull request #1434 from NullVoxPopuli/enable-prettier-in-ci
Add prettier to lint, don't run lint with tests
2 parents 2fb727b + deaae12 commit 830c356

File tree

11 files changed

+60
-22
lines changed

11 files changed

+60
-22
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
jobs:
14+
lint:
15+
name: Lints
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 10
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: pnpm/action-setup@v4
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: 18
25+
cache: 'pnpm'
26+
- run: pnpm install
27+
- run: pnpm lint
28+
1429
test:
1530
name: Tests
1631
runs-on: ubuntu-latest
@@ -24,7 +39,6 @@ jobs:
2439
node-version: 18
2540
cache: 'pnpm'
2641
- run: pnpm install
27-
- run: pnpm lint
2842
- run: pnpm test:ember
2943

3044
test-node:

.prettierignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,11 @@
1111

1212
# ember-try
1313
/.node_modules.ember-try/
14+
15+
# Ignored when enabling prettier in CI
16+
# Changes are too much, and also not super functional
17+
*.yml
18+
*.yaml
19+
*.md
20+
*.html
21+
*.json

addon-test-support/-private/async-iterator.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ export default class AsyncIterator {
115115
);
116116
reject(err);
117117
} else {
118-
119118
console.error(
120119
`EmberExam: Promise timed out after ${this._timeout} s while waiting for response for ${this._request}. Closing browser to exit gracefully.`,
121120
);

addon-test-support/load.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ let loaded = false;
1111
*/
1212
export default function loadEmberExam() {
1313
if (loaded) {
14-
1514
console.warn('Attempted to load Ember Exam more than once.');
1615
return;
1716
}

lib/commands/exam/iterate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ module.exports = {
7272
input = chalk.blue(input);
7373
}
7474

75-
console.info(input);
75+
console.info(input);
7676
},
7777

7878
/**

lib/utils/test-page-helper.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ function getTestUrlFromTestemConfig(configFile) {
156156
// If there is no test_page to use as the testPage, we warn that we're using
157157
// a default value
158158
if (!testPage) {
159-
160159
console.warn(
161160
'No test_page value found in the config. Defaulting to "tests/index.html?hidepassed"',
162161
);

lib/utils/tests-options-validator.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ module.exports = class TestsOptionsValidator {
171171
let split = options.split;
172172

173173
if (typeof split !== 'undefined' && split < 2) {
174-
175174
console.warn(
176175
'You should specify a number of files greater than 1 to split your tests across. Defaulting to 1 split which is the same as not using `split`.',
177176
);

node-tests/unit/utils/tests-options-validator-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ describe('TestOptionsValidator', function () {
4343
}
4444

4545
function shouldWarn(cmd, options, value, emberCliVer = '3.7.0') {
46-
4746
let originalWarn = console.warn;
4847
let warnCalled = 0;
4948
let warnMessage = '';
@@ -58,7 +57,6 @@ describe('TestOptionsValidator', function () {
5857
assert.strictEqual(warnMessage, value);
5958

6059
console.warn = originalWarn;
61-
6260
}
6361

6462
describe('shouldSplit', function () {

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,13 @@
1919
"scripts": {
2020
"build": "ember build --environment=production",
2121
"coverage": "nyc report --reporter=text-lcov | codeclimate-test-reporter",
22+
"format": "prettier . --write",
2223
"lint": "concurrently \"npm:lint:*(!fix)\" --names \"lint:\"",
24+
"lint:format": "prettier . --cache --check",
2325
"lint:hbs": "ember-template-lint .",
2426
"lint:js": "eslint .",
2527
"start": "ember serve",
26-
"test": "concurrently \"npm:lint\" \"npm:test:*\" --names \"lint,test:\"",
28+
"test": "concurrently \"npm:test:*\"",
2729
"test:ember": "ember test",
2830
"test:ember-compatibility": "ember try:each",
2931
"test:node": "nyc mocha 'node-tests/**/*-test.js'"

tests/dummy/app/templates/docs.hbs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
{{nav.section "Options"}}
99
{{nav.item "Randomization" "docs.randomization"}}
1010
{{nav.item "Randomization Iterator" "docs.randomization-iterator"}}
11-
{{nav.item "Generating Module Metadata For Test Execution" "docs.module-metadata"}}
11+
{{nav.item
12+
"Generating Module Metadata For Test Execution"
13+
"docs.module-metadata"
14+
}}
1215
{{nav.item "Splitting" "docs.splitting"}}
1316
{{nav.item "Split Test Parallelization" "docs.split-parallel"}}
1417
{{nav.item "Filtering" "docs.filtering"}}
@@ -23,4 +26,4 @@
2326
<viewer.main>
2427
{{outlet}}
2528
</viewer.main>
26-
</DocsViewer>
29+
</DocsViewer>

0 commit comments

Comments
 (0)