-
Notifications
You must be signed in to change notification settings - Fork 10
feature: parse apiv2 patterns jsonData into pylintrc type file - PLUTO-1358 #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferences |
There was a problem hiding this 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 introduces functionality to parse API v3 pattern JSON data into a Pylint RC configuration file. Key changes include:
- Adding new type definitions for Pylint pattern configurations in tools/types/pylint_types.go.
- Implementing a mapping function to derive section names for Pylint parameters in tools/pylint/src/pylintParameterSectionMap.go.
- Providing functions to parse the JSON data, generate a pylintrc file, and group parameters by section in tools/pylint/src/pylintConfigParser.go.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tools/types/pylint_types.go | Added new type definitions for Pylint pattern configurations |
| tools/pylint/src/pylintParameterSectionMap.go | Introduced mapping for parameter section names to support configuration |
| tools/pylint/src/pylintConfigParser.go | Added JSON parsing, RC file generation, and grouping logic for patterns |
Comments suppressed due to low confidence (1)
tools/types/pylint_types.go:5
- [nitpick] Consider renaming field 'Id' to 'ID' to align with Go naming conventions.
Id string
448635c to
5ab42dc
Compare
machadoit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you mention apiv3 on the title, but we still rely on the v2 here right? Regardless, semms that it should do the trick!
| package pylint | ||
|
|
||
| // DefaultPatterns contains the list of default Pylint patterns | ||
| var DefaultPatterns = []string{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is the thing that we can change to get from the API, but I am fine moving forward with this on this scope
| var testData = `{ | ||
| "patterns": [ | ||
| { | ||
| "patternDefinition": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe as a test, we can have here less patterns?
machadoit
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
fixed test updated to use the ight v2 endpoint creating default pylint if no configuration found
53d2c29 to
c4a521f
Compare
No description provided.