Isort: trailing comma mode doesn't recognize # noqa

Created on 30 Jul 2020  路  1Comment  路  Source: PyCQA/isort

bug overview

isort keeps adding trailing comma to # noqa: blocks

repro

isort version:

 isort --version | grep VERSION
                            VERSION 4.3.21

OS, macOS 10.14.6

uname -v
Darwin Kernel Version 18.7.0: Thu Jun 20 18:42:21 PDT 2019; root:xnu-4903.270.47~4/RELEASE_X86_64

code

temp.py:

# coding: utf-8

from __future__ import absolute_import

import unittest

import swagger_generated.stub
from swagger_generated.stub.models.list_artifacts_result import ListArtifactsResult # noqa: E501
from swagger_generated.stub.rest import ApiException

step to repro

isort -up -tc temp.py

result

# coding: utf-8

from __future__ import absolute_import

import unittest

import swagger_generated.stub
from swagger_generated.stub.models.list_artifacts_result import (
    ListArtifactsResult)  # noqa: E501,
from swagger_generated.stub.rest import ApiException

repeat the command to repro, it will add a trailing comma each time.

documentation question

Most helpful comment

Hi @guihao-liang,

Thanks for reporting! It looks like you are using an outdated version of isort. This issue has been fixed in the 5.x series, and unfortunately there is not capacity to support more than one major version of the product at a time. If you need help upgrading to the new version see: https://timothycrosley.github.io/isort/docs/upgrade_guides/5.0.0/.

Thanks!

~Timothy

>All comments

Hi @guihao-liang,

Thanks for reporting! It looks like you are using an outdated version of isort. This issue has been fixed in the 5.x series, and unfortunately there is not capacity to support more than one major version of the product at a time. If you need help upgrading to the new version see: https://timothycrosley.github.io/isort/docs/upgrade_guides/5.0.0/.

Thanks!

~Timothy

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kevindaum picture kevindaum  路  4Comments

cjerdonek picture cjerdonek  路  3Comments

ionelmc picture ionelmc  路  3Comments

ghickman picture ghickman  路  3Comments

ionelmc picture ionelmc  路  3Comments