DenverCoder1/latex-gboard-dictionary

Bash: check for duplicate lines in the dictionary file

Opened this issue · 2 comments

The dictionary should not contain the same shortcut twice. As a linting feature, it can be made to check if a shortcut appears more than once. Checking for entire line duplicates should be sufficient.

Relevant file: https://github.com/DenverCoder1/latex-gboard-dictionary/blob/master/.github/lint

I can work on this! I'd like to extend it beyond entire line duplicates tho, to also check for conflicting shortcuts. When one is found, would I just flag it? Or could my program ask for an (optional) alternative shortcut for one of them? For example, \Rightarrow on lines 384 and 547 conflict, ⇒ vs ⟹. I believe ⟹ should be assigned to \implies instead. Or \phi as both φ and ϕ; the latter should be reassigned to \varphi.

Sounds great!

The lint script should exit with a non-zero exit code if a problem is found in order for the Check to fail.

Any additional context you can add to the output would be great. Outputting which line(s) have the problem would definitely be nice. The program wouldn't be able to read in user input since it's running as a GitHub workflow in the background, but if you have ideas on how it could be improved feel free.