0

I have a python file and I have disabled some pycodestyles errors(in the code editor) like

pycodestyle: error E501 - line too long (111 > 79 characters)

Is there a standard way to add this info in the python file itself in the beginning as a comment like adding the encoding.

# -*- encoding: utf-8 -*-
import packages
...
main()

The python file is very small and I don't want to add these as a separate file or is adding those info in a separate file considered to be standard?

I am looking for something like

# -*- encoding: utf-8 -*-
# Pycodestyle ignore [E501, E502]
import packages
...
main()
kaya3
  • 47,440
  • 4
  • 68
  • 97
john wick
  • 73
  • 9
  • This warning is a part of `pep8`. Your lines must not exceed `82` chars. And the warning is coming from a debugger such as your IDE. You can set up your IDE to not check the line length. But why you don't fix the problem by line breaks? – MSH Aug 13 '22 at 18:12
  • I am just trying to ignore "line too long" in python since I have long lines in many places where following the standard would make it harder to understand. When someone else opens my code they are greeted with this error. In order to avoid that I want to write these ignored error codes so that the other person can quickly add them to their settings and remove them when done. – john wick Aug 13 '22 at 18:13
  • What IDE are you using? Check if it supports scripts. If yes, create a script to add the lines for each new file created. – MSH Aug 13 '22 at 18:17

0 Answers0