You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am looking at the default undesirable_function_linter() throwing for this:
par('usr')
because the default looks for any call to par(). But actually, what the lint reasoning really cares about is writing device settings, not reading them.
So we might want to tweak the XPath for par(): //SYMBOL_FUNCTION_CALL[text() = 'par']/parent::expr/following-sibling::EQ_SUB, i.e. it has to use a keyword argument.
I think this feature is quite generalizable -- I've definitely encountered situations where a function is undesirable in some-but-not-all circumstances, and rather than introducing a new par_linter() (or generally foo_linter()) every time there's a minor rule that's just outside of what undesirable_function_linter() can accomplish, it would be good to extend undesirable_function_linter() itself to be able to handle these situtations.
What remains is to come up with a good design for this. The first thing that comes to mind is to accept a list instead of just a string:
I am looking at the default
undesirable_function_linter()
throwing for this:par('usr')
because the default looks for any call to
par()
. But actually, what the lint reasoning really cares about is writing device settings, not reading them.So we might want to tweak the XPath for
par()
://SYMBOL_FUNCTION_CALL[text() = 'par']/parent::expr/following-sibling::EQ_SUB
, i.e. it has to use a keyword argument.I think this feature is quite generalizable -- I've definitely encountered situations where a function is undesirable in some-but-not-all circumstances, and rather than introducing a new
par_linter()
(or generallyfoo_linter()
) every time there's a minor rule that's just outside of whatundesirable_function_linter()
can accomplish, it would be good to extendundesirable_function_linter()
itself to be able to handle these situtations.What remains is to come up with a good design for this. The first thing that comes to mind is to accept a list instead of just a string:
I think this would also help with (if not obviate) #1912, #1770.
The text was updated successfully, but these errors were encountered: