Allow unassigned EIP number placeholder - #174
Conversation
| if self.0.as_ref() == "eip" && field.value().trim() == "<to be assigned>" { | ||
| return Ok(()); | ||
| } |
There was a problem hiding this comment.
I dislike hardcoding specifics directly into the code. If we, for example, rename the field to number: or want to change the placeholder, we'd have to release a new version instead of just updating the config file.
That said, I don't think we can just return Ok(()) here, can we? We need at least one error to prevent eipw from exiting with success. Unless there's another lint that catches this?
There was a problem hiding this comment.
Good point. I changed this so the placeholder is configured on preamble-eip instead of hardcoded in Uint.
<to be assigned> still emits one preamble-eip error, so eipw exits unsuccessfully for that file. The configured message only replaces the generic unsigned-integer wording for that value.
I also added an eipv fixture for the default config path and reran the workspace tests.
…igned-placeholder # Conflicts: # src/main.rs
Fixes #13.
This keeps the unassigned-number placeholder in the default lint config.
preamble-eipnow reports<to be assigned>with a placeholder-specific message, while genericUintvalidation still treats non-numeric values as invalid.Checked:
cargo fmt --checkcargo check --all-features --lockedcargo test -p eipw-lint --features tokiocargo test --workspacecargo run -p eipw --quiet -- eipw-lint/tests/eipv/preamble-eip-placeholder/input.mdreturns onepreamble-eiperror for the placeholdergit diff --check