SCR203: unknown-system-keyword
Keyword argument a system.* function does not accept
| Code | SCR203 |
| Name | unknown-system-keyword |
| Category | Scripts (SCR) |
| Default severity | error |
| Enabled by default | yes |
| Fix available | no |
| ign-lint equivalent | none |
What it does
Section titled “What it does”Reports keyword arguments to system.* functions that the function does
not accept in the scope the script runs in: any keyword passed to a
function implemented as a plain Java method (those take positional
arguments only), and a keyword that is not a parameter name of a function
implemented in Python.
Unknown keywords of Java functions that accept keywords (@KeywordArgs,
most of the 8.x API) are not reported: some of them parse their arguments
with PyArgParser, which rejects unknown keywords, but others read them
into a map (PyArgumentMap) that silently ignores them, and the stubs do
not record which one a function uses.
The same exclusions as SCR202 apply: calls that unpack arguments,
functions whose parameters the stubs do not know, and, in library
modules, calls that are valid in at least one scope where the function
exists.
Why is this bad?
Section titled “Why is this bad?”Jython raises TypeError when the call runs ("takes no keyword
arguments" or "unexpected keyword argument").
Example
Section titled “Example”def runAction(self, event): later = system.date.addDays(date=system.date.now(), value=1)Use instead:
def runAction(self, event): later = system.date.addDays(system.date.now(), 1)Generated from the rule metadata by iglint generate-docs; iglint rule SCR203 prints the same page in the terminal. Source: docs/rules/SCR203.md.