Skip to content

Commit 7731ea1

Browse files
authoredDec 8, 2020
Disable warnings when running in a GitHub Actions workflow (#508)
1 parent 97070f0 commit 7731ea1

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
 

Diff for: ‎cli-main.js

+4
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ if (typeof options.space === 'string') {
135135
}
136136
}
137137

138+
if (process.env.GITHUB_ACTIONS) {
139+
options.quiet = true;
140+
}
141+
138142
const log = report => {
139143
const reporter = options.reporter || process.env.GITHUB_ACTIONS ? xo.getFormatter(options.reporter || 'compact') : formatterPretty;
140144
process.stdout.write(reporter(report.results));

Diff for: ‎readme.md

+4
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ XO will handle the [@typescript-eslint/parser `project` option](https://github.c
293293

294294
See [eslint-config-xo-flow#use-with-xo](https://github.com/xojs/eslint-config-xo-flow#use-with-xo)
295295

296+
## GitHub Actions
297+
298+
XO uses a different formatter when running in a GitHub Actions workflow to be able to get [inline annotations](https://developer.github.com/changes/2019-09-06-more-check-annotations-shown-in-files-changed-tab/). XO also disables warnings here.
299+
296300
## Config Overrides
297301

298302
XO makes it easy to override configs for specific files. The `overrides` property must be an array of override objects. Each override object must contain a `files` property which is a glob string, or an array of glob strings, relative to the config file. The remaining properties are identical to those described above, and will override the settings of the base config. If multiple override configs match the same file, each matching override is applied in the order it appears in the array. This means the last override in the array takes precedence over earlier ones. Consider the following example:

0 commit comments

Comments
 (0)
Please sign in to comment.