是否可以更改项目中一个文件的max-line-length
设置(同时执行rc文件中定义的所有其他检查)?
理想情况下,它应该像内联pylint: disable=x
条评论一样。
我已尝试将此行放在模块级别上:
# pylint: max-line-length=240
PyLint无法识别它:
my_file.py:15: [E0011(unrecognized-inline-option), ] Unrecognized file option 'max-line-length
编辑:我知道我可以完全禁用line-too-long
检查,但说实话我想避免这样做,以防万一有人会尝试扩展此模块并添加比他们更长的行现在。
答案 0 :(得分:5)
根据the doc,我认为你无法在线修改pylint配置。
但您可以仅使用# pylint: disable=line-too-long
# disable for only one line
ridiculously_long_variable_name = "this is not a ridiculously long and useless python line" # pylint: disable=line-too-long
# disable for few (or more) lines
# pylint: disable=line-too-long
ridiculously_long_variable_name = "this is not a ridiculously long and useless python line"
# pylint: enable=line-too-long
答案 1 :(得分:3)
您可以传递以下内容:
C:\Python27\Scripts\pylint.exe --max-line-length=240 <PATH TO FILE>
答案 2 :(得分:1)
您可以在python脚本中创建.pylintrc
文件来覆盖pylint设置并放入其中
max-line-length=240
根据您的选择编辑240。
答案 3 :(得分:0)
<select name="employeeList[]" id="employeeList" class="form-control" <? echo !empty($selectMultiple) ? $selectMultiple : '' ?>>
<?php
foreach($employeeList as $employee) {
echo "<option value='" . $employee->$employeeId . "'>" .
$employee->employeeName . "</option>";
}
?>
适合我。