Skip to content

Conversation

@antongolub
Copy link
Member

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the condition that checks for uniform line lengths by rounding all lines up to a fixed width and adjusts the parsing logic accordingly. It also adds a new test case covering an alternate WMIC output.

  • Introduce a constant LL and a roundUp helper to normalize line lengths.
  • Update parseWinGrid to use the rounded length (limit) for homogeneity checks and slicing.
  • Add a new fixture and test (wmic-gha-output-2.txt) to verify the updated parsing behavior.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/test/ts/ingrid.test.ts Added a new test case for a second WMIC output fixture.
src/test/fixtures/wmic-gha-output-2.txt Provided a new sample WMIC output for testing.
src/main/ts/ingrid.ts Introduced LL and roundUp, updated homogeneity logic.
Comments suppressed due to low confidence (1)

src/main/ts/ingrid.ts:131

  • [nitpick] The helper name roundUp is generic; consider a more specific name like roundToColumnWidth to clarify that it rounds a line length to the defined column width.
const roundUp = (l: number) => Math.ceil(l / LL) * LL


const EOL = /\r?\n|\r|\n/
const EMPTY = '-'
const LL = 80
Copy link

Copilot AI Jul 11, 2025

Choose a reason for hiding this comment

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

[nitpick] The constant LL is a magic number and its purpose (fixed column width) isn’t immediately clear. Consider renaming it to something descriptive (e.g., COLUMN_CHUNK_SIZE) or adding a comment explaining why it’s set to 80.

Suggested change
const LL = 80
// Fixed column width for text formatting, commonly set to 80 characters.
const COLUMN_CHUNK_SIZE = 80

Copilot uses AI. Check for mistakes.
@antongolub antongolub merged commit 47def63 into main Jul 11, 2025
7 checks passed
@antongolub antongolub deleted the fix-ll-check branch July 11, 2025 08:43
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.

2 participants