【问题标题】:Ignore Flake8 "Line too long" error in gitlab CI忽略 gitlab CI 中的 Flake8“行太长”错误
【发布时间】:2022-01-25 01:15:11
【问题描述】:

我在我的 gitlab CI 阶段使用flake8。我的.gitlab-ci.yaml linting 阶段如下所示:

linting:
  stage: linting
  tags:
    - docker
  before_script:
    - pip3 install flake8
  script:
    - flake8 .
  only:
    - merge_requests

有没有办法在运行我的管道时忽略 “line too long” 错误?像要编辑的 conf 文件?

【问题讨论】:

    标签: python gitlab gitlab-ci lint flake8


    【解决方案1】:

    是的,你可以通过传递参数来做到这一点。

    linting:
      stage: linting
      tags:
        - docker
      before_script:
        - pip3 install flake8
      script:
        - flake8 --ignore=E501 .
      only:
        - merge_requests
    

    【讨论】:

    • 很好用!谢谢 :) 有没有办法编辑行限制?在 flake8 中是 79。
    • 是的,这让另一个论点感到惊讶flake8 --max-line-length=120 --ignore=E501 .
    猜你喜欢
    • 1970-01-01
    • 2021-04-04
    • 1970-01-01
    • 2023-01-16
    • 2019-07-05
    • 2016-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多