Skip to content

Features/add list operation#23

Draft
kin0992 wants to merge 3 commits intomainfrom
features/add-list-operation
Draft

Features/add list operation#23
kin0992 wants to merge 3 commits intomainfrom
features/add-list-operation

Conversation

@kin0992
Copy link
Copy Markdown
Owner

@kin0992 kin0992 commented Sep 27, 2025

No description provided.

Copilot AI review requested due to automatic review settings September 27, 2025 13:19
Copy link
Copy Markdown

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 adds a new list operation to the GitIgnoreIO SDK, enabling users to retrieve available technologies from the gitignore.io API.

  • Adds listTechnologies() method to fetch available technologies
  • Renames GitIgnoreResult interface to GitIgnoreContent for better clarity
  • Includes comprehensive test coverage for the new functionality

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/gitignoreio-sdk/src/domain/index.ts Renames interface and adds listTechnologies method to SDK contract
packages/gitignoreio-sdk/src/adapters/sdk.ts Implements listTechnologies method with API call and response parsing
packages/gitignoreio-sdk/src/adapters/tests/sdk.test.ts Adds test cases for the new listTechnologies functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +58 to 60
return result as unknown as Technologies[];
}
}
Copy link

Copilot AI Sep 27, 2025

Choose a reason for hiding this comment

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

The double type assertion as unknown as suggests a type mismatch. Consider properly typing the result from the API response parsing or creating a proper type guard function to validate the data structure before returning.

Suggested change
return result as unknown as Technologies[];
}
}
if (!isTechnologiesArray(result)) {
throw new Error('API response does not match expected Technologies[] type');
}
return result;
}
}
/**
* Type guard to check if a value is a Technologies[] (array of non-empty strings).
*/
function isTechnologiesArray(arr: unknown): arr is Technologies[] {
return (
Array.isArray(arr) &&
arr.every((item) => typeof item === 'string' && item.trim().length > 0)
);
}

Copilot uses AI. Check for mistakes.
);
expect(result).toStrictEqual(['a', 'b', 'c']);
});

Copy link

Copilot AI Sep 27, 2025

Choose a reason for hiding this comment

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

There's trailing whitespace on this line. Remove the extra spaces for consistent formatting.

Suggested change

Copilot uses AI. Check for mistakes.
@kin0992 kin0992 force-pushed the features/add-list-operation branch from 02003ef to 659cbd2 Compare September 27, 2025 13:20
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.59%. Comparing base (fe4db67) to head (659cbd2).

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #23       +/-   ##
===========================================
+ Coverage   35.10%   98.59%   +63.48%     
===========================================
  Files           9        7        -2     
  Lines          94       71       -23     
  Branches       15       24        +9     
===========================================
+ Hits           33       70       +37     
+ Misses         61        1       -60     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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