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

feat: introduce ArgumentContext to replace ArgumentTiming #461

Merged
merged 3 commits into from
Jul 28, 2023

Conversation

Citymonstret
Copy link
Member

The commit introduces the ArgumentContext class, deprecating the ArgumentTiming functionality in the CommandContext.java file, providing a comprehensive log of consumed inputs and parsing duration. This change enhances the precision and maintainability by providing more details about the argument parsing stage. CommandTree.java is also updated to adopt ArgumentContext in place of ArgumentTiming during parsing, while ArgumentContext.java is a new file introduced to store specific details about each argument's consumption of input and its parse times.

The commit introduces the ArgumentContext class, deprecating the ArgumentTiming functionality in the CommandContext.java file, providing a comprehensive log of consumed inputs and parsing duration. This change enhances the precision and maintainability by providing more details about the argument parsing stage. CommandTree.java is also updated to adopt ArgumentContext in place of ArgumentTiming during parsing, while ArgumentContext.java is a new file introduced to store specific details about each argument's consumption of input and its parse times.
@github-actions
Copy link

Test Results

  52 files  ±0    52 suites  ±0   6s ⏱️ -1s
228 tests ±0  228 ✔️ ±0  0 💤 ±0  0 ±0 
229 runs  ±0  229 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 6448e58. ± Comparison against base commit b4b0b9c.

The updated ArgumentContext.java now includes a new function that allows the retrieval of a list of consumed inputs. This modification was implemented to improve argument parsing, making it easier to discern and analyse the exact sequence of inputs consumed by an argument during the parsing stage, therefore enhancing the application's logging detail and command processing accountability.
Unit tests for the ArgumentContext class were added to ensure that its functionalities, such as "consumedInput" and "exactAlias", are working correctly. This includes testing the command building and execution process. This will help in quickly identifying and fixing any potential issues in the future.
@Citymonstret Citymonstret marked this pull request as ready for review July 28, 2023 09:22
@Citymonstret Citymonstret merged commit 7efbec3 into 1.9.0-dev Jul 28, 2023
3 checks passed
@Citymonstret Citymonstret deleted the feat/argument-context branch July 28, 2023 09:22
Citymonstret added a commit that referenced this pull request Dec 21, 2023
The label may contain the namespace prefix. This reverts a change introduced in #461.
Citymonstret added a commit that referenced this pull request Dec 21, 2023
The label may contain the namespace prefix. This reverts a change introduced in #461.

(cherry picked from commit ad6b8d0)
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.

1 participant