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

Fix bug in unmanaged arguments processing #7

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

jocgir
Copy link

@jocgir jocgir commented Nov 13, 2024

  • Fix a bug that was causing some arguments to be eaten when handling Unmanaged arguments
  • Add some tests
  • Fix deprecated warnings

This pull request includes various improvements and refactoring across multiple files to enhance the codebase's readability, maintainability, and functionality. The changes include adding new test cases, refactoring existing functions, and updating deprecated methods.

Test Enhancements:

  • app_test.go: Added new test cases to handle scenarios with mixed valid and invalid flags.

Refactoring and Code Simplification:

  • flags.go: Refactored the parse method in flagGroup to simplify the handling of unmanaged flags and improve code readability. [1] [2] [3]
  • parser.go: Simplified the Next method in ParseContext by removing redundant conditions and simplifying the token parsing logic.

Deprecated Method Updates:

  • parser_test.go, parsers_test.go: Replaced deprecated ioutil.TempFile with os.CreateTemp for creating temporary files in tests. [1] [2] [3] [4] [5] [6]

Consolidation of Test Cases:

  • parser_test.go: Consolidated multiple test functions into a single table-driven test function to improve test organization and coverage.

These changes collectively aim to improve the robustness and clarity of the codebase, ensuring better handling of edge cases and more maintainable code.

@jocgir jocgir force-pushed the DT-7419-Fix-a-bug-in-argument-evaluation branch 2 times, most recently from f0692e5 to 26dd1b7 Compare November 13, 2024 14:17
@jocgir jocgir requested a review from lpbedard November 13, 2024 14:26
@jocgir jocgir force-pushed the DT-7419-Fix-a-bug-in-argument-evaluation branch from 26dd1b7 to 26cc36a Compare November 13, 2024 14:32
- Fix a bug that was causing some arguments to be eaten when handling Unmanaged arguments
- Add some tests
- Fix deprecated warnings
- Rename the master branch to main
- Transfer the repository under coveooss
@jocgir jocgir force-pushed the DT-7419-Fix-a-bug-in-argument-evaluation branch from 26cc36a to a0752f5 Compare November 13, 2024 14:32
@jocgir jocgir merged commit 9568cfa into main Nov 13, 2024
3 checks passed
@jocgir jocgir deleted the DT-7419-Fix-a-bug-in-argument-evaluation branch November 13, 2024 16:11
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.

3 participants