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

Enable automatic annotations on GitHub Actions #497

Merged
merged 2 commits into from Oct 17, 2020
Merged

Enable automatic annotations on GitHub Actions #497

merged 2 commits into from Oct 17, 2020

Conversation

fregante
Copy link
Member

@fregante fregante commented Sep 12, 2020

Closes #465

I tested locally and the logic seems correct:

❯ xo

  index.js:10:15
  ✖  10:15  Multiple spaces found before =.  no-multi-spaces
  ✖  11:41  Missing semicolon.               semi

  2 errors

❯ export GITHUB_ACTIONS=true
❯ xo
./index.js: line 10, col 15, Error - Multiple spaces found before '='. (no-multi-spaces)
./index.js: line 11, col 41, Error - Missing semicolon. (semi)

2 problems⏎

However I don't know if this actually works on GHA. The syntax that appears on GHA (as shown in #465) is not this one.

cli-main.js Outdated Show resolved Hide resolved
@@ -136,7 +136,7 @@ if (typeof options.space === 'string') {
}

const log = report => {
const reporter = options.reporter ? xo.getFormatter(options.reporter) : formatterPretty;
const reporter = options.reporter || process.env.GITHUB_ACTIONS ? xo.getFormatter(options.reporter || 'compact') : formatterPretty;
Copy link
Member Author

Choose a reason for hiding this comment

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

A bit "clever" but this avoids the nested ternary operator

@fregante
Copy link
Member Author

Travis is stuck, but passes

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.

Report errors as GitHub Actions Annotations
2 participants