Solves Issue #321: Check for space separated keywords#323
Solves Issue #321: Check for space separated keywords#323JacobEFO wants to merge 3 commits intoKiCad:masterfrom
Conversation
This way of finding illegal keyword separators within symbols need python regular expressions.
A simple approach in finding illegal keyword separators is implemented. It current filters keyword separation based on a regular expression, looking for the following symbols: ,.:;?!<> Maybe a different approach is better, and more symbols may be interesting to filter with.
Some symbols appeared to have no "K" entry within its .dcm file, and thus assigning the variable "keywords" threw an error. Solved this with a try/except and append a warning message to the -vv logger.
|
I think we need to discuss the list of illegal symbols. edit: I was thinking of description where different rules apply. |
|
Hey @cpresser The list of symbols was merely a suggestion/prototype. The list is not exhaustive. There may be other more interesting symbols to filter from or some to exclude. Realistic symbols may be more: ",.:;|" or similarly. Using this list of illegal symbols is just a simple yet efficient way to handle keyword seperation. |
|
I did a little testing and think that Missing keywords generating a warning is good. I like that. |
A naive approach to handling space separated keywords fixing #321
The thought was, that it would be more interesting to find keywords separated with a list of illegal symbols, such as:
,.:;?!<>Currently allowing especially hyphen (-) to get through, because it appears to be used already within keywords. A primary issue atm is, that some symbols such as within CPLD_Xilinx.lib contain no "K" field in its .dcm file. This triggered an error, that I handle with a try/except.
if the error is triggered it appends to the warnings, that symbols appear to not have any keywords. If illegal characters are found within the keywords, an error is appended saying it found the following illegal characters and prints them.
I would like to hear, what you think of the solution, and what specific sort of characters should be searched for within the keywords.