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

Add support for a TAP formatter #5062

Merged
merged 3 commits into from
Jan 16, 2021
Merged

Conversation

clinejj
Copy link
Contributor

@clinejj clinejj commented Nov 25, 2020

This PR adds support for a TAP formatter using an update to the code snippet from @danielsamuels discussed in #3889.

Which issue, if any, is this issue related to?

Closes #3889

Is there anything in the PR that needs further explanation?

No, it is self explanatory. Used #3524 as a starting point.

lib/formatters/tapFormatter.js Show resolved Hide resolved
@@ -91,7 +91,14 @@ declare module 'stylelint' {
returnValue?: StylelintStandaloneReturnValue,
) => string;

export type FormatterIdentifier = 'compact' | 'json' | 'string' | 'unix' | 'verbose' | Formatter;
export type FormatterIdentifier =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added tap as an option but format was adjusted by prettier

Copy link
Member

@vankop vankop left a comment

Choose a reason for hiding this comment

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

Thanks for your PR

lib/formatters/tapFormatter.js Show resolved Hide resolved
lib/formatters/tapFormatter.js Show resolved Hide resolved
@jeddy3 jeddy3 mentioned this pull request Jan 11, 2021
6 tasks
Signed-off-by: John Cline <2057878+clinejj@users.noreply.github.com>
Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

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

Thank you!

@jeddy3 jeddy3 merged commit e9e5692 into stylelint:master Jan 16, 2021
@jeddy3
Copy link
Member

jeddy3 commented Jan 16, 2021

Changelog entry:

  • Added: TAP formatter (#5062).

);
});

lines.push('---');
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

We have implemented the version 13, not version 14:

const lines = [`TAP version 13\n1..${results.length}`];

But it seems v13 also requires an ending ..., according to https://testanything.org/tap-version-13-specification.html:

If the test line is immediately followed by an indented block beginning with /^\s+---/ and ending with /^\s+.../ that block will be interpreted as an inline YAML document.

So, it makes sense for me to fix --- to .... Additionally, we might be able to update the TAP version from 13 to 14.

Can you create an issue or pull request if you have time?

Copy link
Member

@Mouvedia Mouvedia Jun 14, 2024

Choose a reason for hiding this comment

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

I was reviewing which formatter would have the fixed mention.
see #4664 (comment)

Can you create an issue or pull request if you have time?

Not right away no, but what I wonder is why it wasn't picked up for all these years.
The tap consumers must be very lax.
This is weird.

update the TAP version from 13 to 14

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add TAP formatter
5 participants