Merged
Conversation
There was a problem hiding this comment.
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
LLand aroundUphelper to normalize line lengths. - Update
parseWinGridto 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
roundUpis generic; consider a more specific name likeroundToColumnWidthto 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 |
There was a problem hiding this comment.
[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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.