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

Unused grammar rule clean-up and grammar coverage tests #86

Merged
merged 4 commits into from
Oct 24, 2023
Merged

Conversation

klauer
Copy link
Owner

@klauer klauer commented Oct 24, 2023

(This is part of a larger branch which got to be unmanageably large - breaking it up into separate PRs)

Fixes:

  • Fixes incorrect escape character for double quotes in double-byte strings ("$"")
  • Don't add more parentheses than required when formatting dataclasses back to code (specifically for ObjectInitializerArray)

Clean-up:

  • Removed unused grammar rules structured_var_declaration, function_var_decl, step_*, etc.
  • Removed grammatical alias structure_type_name from var_spec (since simple_spec covers it just fine)

Test suite:

  • More coverage for grammar rules in test_transformer
  • Coverage check to ensure that all known rules are hit (terminals are a bit buggy there, but I'm not too worried about it)
    • This is opt-in, setting BLARK_CHECK_GRAMMAR_COVERAGE=1 in the environment prior to running the test suite (since you might only run part of the test suite and it'd be annoying for the coverage check to fail then)

@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2023

Codecov Report

Merging #86 (58f5bc6) into master (16498b7) will increase coverage by 0.1%.
The diff coverage is 94.7%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master     #86     +/-   ##
========================================
+ Coverage    80.7%   80.8%   +0.1%     
========================================
  Files          26      26             
  Lines        5510    5559     +49     
========================================
+ Hits         4447    4493     +46     
- Misses       1063    1066      +3     
Files Coverage Δ
blark/tests/test_transformer.py 94.7% <100.0%> (+1.2%) ⬆️
blark/transform.py 98.9% <100.0%> (+<0.1%) ⬆️
blark/util.py 83.8% <81.2%> (-0.2%) ⬇️

... and 1 file with indirect coverage changes

@klauer klauer merged commit e950984 into master Oct 24, 2023
24 checks passed
@klauer klauer deleted the cln_grammar branch October 24, 2023 21:03
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.

2 participants