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

Basic parsing #9

Merged
merged 10 commits into from
Jan 19, 2025
Merged

Basic parsing #9

merged 10 commits into from
Jan 19, 2025

Conversation

UnstoppableMango
Copy link
Contributor

No description provided.

A new method has been added to the TargetList struct. This method allows appending a target to the existing list of targets in an efficient manner.
The Parser has been refactored for improved readability and efficiency. The NewParser function now directly initializes the Scanner within the Parser struct, eliminating an unnecessary variable. The parseRule function has been streamlined to handle target parsing inline, removing the need for a separate parseTargets function. Error handling is also improved with early returns on error conditions.

Corresponding changes have been made in parser_test.go to reflect these modifications in the Parser structure and behavior.
Introduced a new makefile target 'validate_codecov' to validate the codecov.yml file. Also, added a new codecov.yml file with project coverage settings - setting the target coverage at 75% and threshold at 3%.
Added new methods to the Parser struct in parser.go for improved parsing of rules, prerequisites and recipes. Also added corresponding tests in parser_test.go to ensure correct functionality. The ast.go file was updated with a method to append prerequisites to PreReqList.
In this update, we've added a check for nil files in both the Parser and Scanner constructors. If a nil file is passed, a new one is created with maximum integer size. Additionally, we've exposed the NewFileSet function from the token package for external use.
The README has been updated to reflect changes in the usage of the make.Parser, make.Scanner, and make.ScanTokens. The previous scanning utilities section has been replaced with a more detailed explanation on how to use these functions. Additionally, redundant future plans have been removed from the document.
Copy link

codecov bot commented Jan 19, 2025

Codecov Report

Attention: Patch coverage is 80.76923% with 15 lines in your changes missing coverage. Please review.

Project coverage is 93.57%. Comparing base (b378b8d) to head (611cf21).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
parser.go 78.87% 11 Missing and 4 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #9      +/-   ##
==========================================
- Coverage   95.72%   93.57%   -2.15%     
==========================================
  Files           7        7              
  Lines         374      436      +62     
==========================================
+ Hits          358      408      +50     
- Misses         12       21       +9     
- Partials        4        7       +3     

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

- Corrected the expected position after final recipe in AST test
- Added a new test to check if given target is appended correctly
- Fixed typo in PreReqList description
- Added a new test to verify if given prereq is appended as expected
- Extended Parser and Scanner tests to support nil *token.File value
Added new patch coverage target and threshold to the codecov configuration. The patch target is set at 60% and the threshold at 10%. This will help ensure that new code changes maintain a certain level of test coverage.
@UnstoppableMango UnstoppableMango merged commit e2fa3ed into main Jan 19, 2025
4 of 5 checks passed
@UnstoppableMango UnstoppableMango deleted the parsing branch January 19, 2025 05:43
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