Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

[new-formatter] TAP formatter #2325

Merged
merged 5 commits into from
Mar 10, 2017
Merged

[new-formatter] TAP formatter #2325

merged 5 commits into from
Mar 10, 2017

Conversation

LKay
Copy link
Contributor

@LKay LKay commented Mar 10, 2017

PR checklist

  • Addresses an existing issue: #0000
  • New feature, bugfix, or enhancement
    • Includes tests
  • Documentation update

Overview of change:

Adds new TAP formatter for failures output. Can be used with any TAP reporter

CHANGELOG.md entry:

  • [enhancement] New TAP formatter

@palantirtech
Copy link
Member

Thanks for your interest in palantir/tslint, @LKay! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

CHANGELOG.md Outdated
@@ -44,6 +44,10 @@ v5.0.0

-->

Unreleased
---
- [enhancement] New TAP formatter
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to modify the changelog. that is done when the next version is released to avoid merge conflicts.
Just add [new-formatter] TAP formatter to the opening post of the PR.

@@ -0,0 +1,90 @@
/**
* @license
* Copyright 2013 Palantir Technologies, Inc.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/2013/2017/

` failureString: ${failureString}`,
` rawLines: ${failureRaw}`,
" ...",
].join("\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a suggestion: use multiline template strings and Utils.dedent

            return Utils.dedent`
                not ok ${i + 1} - ${failureMessage}
                  ---
                  message : ${failureMessage}
                  severity: ${failureSeverity}
                  data:
                    ruleName: ${ruleName}
                    fileName: ${fileName}
                    line: ${lineAndCharacter.line}
                    character: ${lineAndCharacter.character}
                    failureString: ${failureString}
                    rawLines: ${failureRaw}
                  ...`;

@LKay LKay changed the title Add TAP formatter for failures [new-formatter] TAP formatter Mar 10, 2017
@nchen63 nchen63 merged commit 00c997c into palantir:master Mar 10, 2017
@nchen63
Copy link
Contributor

nchen63 commented Mar 10, 2017

@LKay thanks!

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

Successfully merging this pull request may close these issues.

4 participants