Skip to content

Commit

Permalink
fix(results): prevent unnecessary text wrap on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Jan 16, 2021
1 parent 22bdc19 commit a836913
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/ui/components/Results.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Static, Text } from 'ink';
import { Static, Text, Box } from 'ink';

import {
ResultsStore,
Expand All @@ -13,6 +13,10 @@ import { useExitAfterRender } from '../hooks';
const START_MESSAGE = '\nResults:';
const NO_ERRORS = ['No errors'];

// This is used to override ink's text wrapping. Especially on Github CI the max
// line width is not really the terminals width. The CI will handle text wrapping.
const LINE_WIDTH = 500;

function formatComparisonResults(
comparisonResults: ComparisonResults | null
): string[] {
Expand Down Expand Up @@ -52,7 +56,11 @@ export default function Results(): JSX.Element {

return (
<Static items={items}>
{(result, index) => <Text key={index}>{result}</Text>}
{(result, index) => (
<Box width={LINE_WIDTH} key={index}>
<Text>{result}</Text>
</Box>
)}
</Static>
);
}

0 comments on commit a836913

Please sign in to comment.