PEP-8忽略最大行长

时间:2019-04-03 20:03:04

标签: python pep8

我在Sublime编辑器中使用PEP8,并且具有以下设置:

{
    // autoformat code on save ?
    "autoformat_on_save": true,

    // enable possibly unsafe changes (E226, E24, W6)
    // aggressive level, 0 to disable:
    "aggressive": 0,

    // list codes for fixes; used by --ignore and --select
    "list-fixes": false,

    // do not fix these errors / warnings (e.g. [ "E501" , "E4" , "W"])
    "ignore": [],

    // select errors / warnings (e.g. ["E4", "W"])
    "select": [],

    // Maximum line length
    "max-line-length": 79
}

我的代码如下:

class MyTests(Tests):
    owner =...
    user = ...

    def create_my_cars(self, k):
        for i in range(k):
            p = MyCars.objects.create(license_plate="1234",color="blue",brand="Toyota", currentLocation="Somehwere in somewhere", owner=owner, user=user)

现在,当我保存文件时,PEP8会将其分解为:

p = MyCars.objects.create(license_plate="1234",color="blue", brand="Toyota", 
                          currentLocation="Somehwere in somewhere", owner=owner, user=user)

但是最后两行仍然比max-line-length(79)长吗?

0 个答案:

没有答案