An `+unlint` value with both quote types can crash linting
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start in src/main/java/org/eolang/lints/LtUnlintNonExistingDefect.java, reading quoted() and the XPath construction in defects(). Reproduce with an +unlint tail containing both a double quote and an apostrophe, then run the linter on the parsed XMIR. Done means the malformed or non-existing suppression is reported without an XPath parse failure.
Written by the indexing model from the issue text.
Description
An invalid +unlint value containing both a double quote and an apostrophe can make linting fail with an XPath parse error instead of reporting the malformed suppression.
Steps to reproduce
- Add an EO
+unlintmeta whose tail contains both quote characters, for exampleunknown"rule'part. - Run the linter on the parsed XMIR.
Actual result
LtUnlintNonExistingDefect builds an XPath expression to find the meta's line number. Its quoted() helper switches to single quotes when the value contains a double quote, but does not escape an apostrophe. The resulting XPath literal is invalid, so lints can abort while processing an invalid suppression.
Expected result
The linter should report the malformed or non-existing unlint value without aborting, regardless of quote characters in its text.
Technical evidence
In src/main/java/org/eolang/lints/LtUnlintNonExistingDefect.java, quoted() chooses either quote style but does not handle a value containing both. defects() passes that value into .../meta[head='unlint' and tail=%s]/@line; the XPath expression breaks when neither chosen quote style is escaped.
- Dominant language
- Java
- Stars
- 14
- Forks
- 41
- Avg merge
- 3d 12m
- Merged PRs (30d)
- 32
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from objectionary/lints
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
objectionary/lints#1611 ·
Maintainers usually reply within 2 days
-
`invalid-name-notation` does not check a name bound with `>>`Possibly taken @StanislavKozachenko claimed this 1 day ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
objectionary/lints#1608 ·
Maintainers usually reply within 2 days
-
`unused-alias` reports an alias that is used only in the type of an atom or a voidPossibly taken @StanislavKozachenko claimed this 1 day ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
objectionary/lints#1607 ·
Maintainers usually reply within 2 days
-
`comment-is-too-wide` splits a comment at a literal `\n`, so it reports a wrong line or misses a wide onePossibly taken @StanislavKozachenko claimed this 1 day ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
objectionary/lints#1600 ·
Maintainers usually reply within 2 days
-
`download-model` in `pom.xml` fetches `en-pos-perceptron.bin` from a dead URL, so a build without a warm `~/.m2` cache fails with 404Possibly taken @StanislavKozachenko claimed this 1 day ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
objectionary/lints#1599 ·
Maintainers usually reply within 2 days
All issues in objectionary/lints
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
snowflakedb/snowflake-kafka-connector#1610 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
swagger-api/swagger-petstore#245 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
liquid-java/liquidjava#443 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
quarkiverse/quarkus-google-cloud-services#1188 ·
Maintainers usually reply within 1 day