Skip to content
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

Minor refactoring of Range and Thresholds support #281

Merged
merged 3 commits into from
Oct 31, 2024

Conversation

atc0005
Copy link
Owner

@atc0005 atc0005 commented Oct 31, 2024

Changes

Refactor the following methods/functions used to provide Range and Thresholds support with the assistance of Google Gemini and OpenAI's ChatGPT:

  • (Range).checkOutsideRange
    • replace existing method with implementation provided by Google Gemini (model 'Gemini 1.5 Flash')
    • include commented out alternative implementation from ChatGPT (model 'GPT-4o') for contrast
  • ParseRangeString
    • rework existing function with suggested changes from ChatGPT (model 'GPT-4o') with an additional small adjustment to reduce the gocognit linter score further
  • Plugin.EvaluateThreshold
    • replace existing method with implementation provided by ChatGPT (model 'GPT-4o'), including closure which was moved to separate evaluateThreshold helper function

References

Replace existing method with implementation provided by Google
Gemini (model 'Gemini 1.5 Flash').

Include commented out alternative implementation from ChatGPT
(model 'GPT-4o') for contrast.

refs GH-278
Rework existing function with suggested changes from ChatGPT
(model 'GPT-4o') with an additional small adjustment to reduce
the gocognit linter score further.

As described by ChatGPT:

> Organizational Improvements:
>
> Each parsing step is now grouped by function (alert inversion,
> infinity handling, start parsing, and end parsing), making it
> easier to follow while keeping the parsing steps in their
> original form.
>
> Retained Validation Checks:
>
> The final if check ensures range validity before returning the
> struct.

refs GH-278
Replace existing method with implementation provided by ChatGPT
(model 'GPT-4o'), including closure which was moved to separate
`evaluateThreshold` helper function.

refs GH-278
@atc0005 atc0005 added bug Something isn't working linting range thresholds labels Oct 31, 2024
@atc0005 atc0005 added this to the Next Dev Release milestone Oct 31, 2024
@atc0005 atc0005 self-assigned this Oct 31, 2024
@atc0005 atc0005 merged commit 009ee3e into development Oct 31, 2024
29 checks passed
@atc0005 atc0005 deleted the i278-minor-range-support-refactoring branch October 31, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant