Automatically resolving flake8 message: "C0301: Line too long"

Viewed 38

Context

While running a flake8-conda check using pre-commit, the outcome prompts me:

code/project1/src/Datapoints.py:8:0: C0301: Line too long (137/100) (line-too-long)
code/project1/src/Datapoints.py:12:0: C0301: Line too long (181/100) (line-too-long)
code/project1/src/Datapoints.py:24:0: C0301: Line too long (130/100) (line-too-long)
code/project1/src/Datapoints.py:25:0: C0301: Line too long (123/100) (line-too-long)
code/project1/src/Datapoints.py:38:0: C0301: Line too long (173/100) (line-too-long)
code/project1/src/Datapoints.py:108:0: C0301: Line too long (104/100) (line-too-long)
code/project1/src/Datapoints.py:113:0: C0301: Line too long (102/100) (line-too-long)
code/project1/src/Datapoints.py:123:0: C0301: Line too long (103/100) (line-too-long)

An example for line 24 and 25, is:

        # Source: https://www.cips.org/supply-management/news/2016/november/logistics-industry-forecast-to-be-worth-155tn-by-2023/
        # NOTE: this article seems an unreliable source and is outdated, hence the 0.15 should possibly be changed/updated.
        self.logistics_market_share_dhl_fedex_ups = 0.15

Question

Is it possible to automatically resolve the line-lengths where possible? (With e.g. autoflake8).

Expected Output

For example, I would expect it is (at least) able to rewrite the last commented line to:

        # Source: 
        # https://www.cips.org/supply-management/news/2016/november/logistics-industry-forecast-to-be-worth-155tn-by-2023/
        # NOTE: this article seems an unreliable source and is outdated, hence
        # the 0.15 should possibly be changed/updated.
        self.logistics_market_share_dhl_fedex_ups = 0.15
0 Answers
Related