Python/Linting: Difference between revisions
< Python
Jump to navigation
Jump to search
| (3 intermediate revisions by the same user not shown) | |||
| Line 7: | Line 7: | ||
! TODO || Code | ! TODO || Code | ||
|- | |- | ||
| Disable function name and arguments | | Generate pylintrc || | ||
<source lang="bash"> | |||
pylint --generate-rcfile > pylintrc | |||
</source> | |||
|- | |||
| Disable function name and arguments for<br/>multi-line function definition.<br/>(Single line mode is invalid here.) || | |||
<source lang="python"> | <source lang="python"> | ||
def OnNotifyTicks(self, sMarketNo, sStockidx, nPtr, \ | |||
nDate, nTimehms, nTimemillis, \ | |||
nBid, nAsk, nClose, nQty, nSimulate): | |||
""" | |||
Handle received ticks. | |||
""" | |||
# pylint: disable=invalid-name, unused-argument, too-many-arguments | |||
# pylint: enable=invalid-name | |||
</source> | </source> | ||
|} | |} | ||
Latest revision as of 07:07, 3 June 2019
Ignore some linting errors/warnings
See: https://pylint.readthedocs.io/en/latest/user_guide/message-control.html
| TODO | Code |
|---|---|
| Generate pylintrc |
pylint --generate-rcfile > pylintrc
|
| Disable function name and arguments for multi-line function definition. (Single line mode is invalid here.) |
def OnNotifyTicks(self, sMarketNo, sStockidx, nPtr, \
nDate, nTimehms, nTimemillis, \
nBid, nAsk, nClose, nQty, nSimulate):
"""
Handle received ticks.
"""
# pylint: disable=invalid-name, unused-argument, too-many-arguments
# pylint: enable=invalid-name
|