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

Switch to Language enum #298

Merged
merged 12 commits into from
Feb 22, 2024
Merged

Switch to Language enum #298

merged 12 commits into from
Feb 22, 2024

Conversation

spenserblack
Copy link
Owner

@spenserblack spenserblack commented Jan 30, 2024

This PR changes the implementation from interpreting language definitions as compile-time to runtime.
This drastically changes the API, both by simplifying it using implementation that can only be used
with compile-time definitions, and also by removing APIs that are impossible without runtime
language definitions.

To do

  • Write enum
  • Add methods for enum
    • By extension
    • By filename
    • By shebang
    • By glob
    • Filter by heuristics
    • Pick by priority
  • Use enum instead of Language struct
  • Implement serialization so that Language struct can be used in JSON output (private LanguageAttrs struct?)
  • Replace Analyzers::pick with Language::pick
  • Remove serde_json and serde_yaml dependencies on main crate (and anything else that runtime parsing depends on)

@spenserblack spenserblack linked an issue Jan 30, 2024 that may be closed by this pull request
Copy link

codecov bot commented Jan 30, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (23de7fd) 87.88% compared to head (69e3e56) 75.05%.
Report is 5 commits behind head on main.

Files Patch % Lines
gengo/src/lib.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #298       +/-   ##
===========================================
- Coverage   87.88%   75.05%   -12.83%     
===========================================
  Files          18       17        -1     
  Lines         619      425      -194     
===========================================
- Hits          544      319      -225     
- Misses         75      106       +31     
Flag Coverage Δ
--no-default-features 73.81% <96.66%> (-13.90%) ⬇️
--no-default-features --features color 74.58% <97.43%> (-10.23%) ⬇️
macOS-latest 66.26% <97.43%> (-21.17%) ⬇️
ubuntu-latest 72.44% <97.22%> (-12.07%) ⬇️
windows-latest 56.90% <79.48%> (-8.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

spenserblack added a commit that referenced this pull request Feb 22, 2024
@spenserblack spenserblack marked this pull request as ready for review February 22, 2024 03:55
@spenserblack spenserblack added the semver-major This pull request bumps the major version label Feb 22, 2024
@spenserblack spenserblack merged commit a969d96 into main Feb 22, 2024
10 of 11 checks passed
@spenserblack spenserblack deleted the breaking/285/language-enum branch February 22, 2024 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-major This pull request bumps the major version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate languages as enum
1 participant