jupyter_core icon indicating copy to clipboard operation
jupyter_core copied to clipboard

The configuration files for Jupyter produce many lint errors now

Open NeilGirdhar opened this issue 9 months ago • 6 comments

The generated configuration files don't adhere to the default behavior of standard linters. In particular:

  • Every # should be followed by exactly one space (there should never be any ##).
  • Every # noqa should be marked with its rule number (in this case, F821). And,
  • there should be no trailing whitespace.

(This appears to have been changed recently.)

I'm not sure if this was the correct project, but I spent about 30 minutes searching through the various projects.

Image

NeilGirdhar avatar Feb 21 '25 10:02 NeilGirdhar

The "too many #", or comment should start with #- seem like a non issue, and should be ignored in the linter.

I think the trailing whitespace comes from the traitlets package.

(and no worries if you don't find the right package, it some dark magic)

Carreau avatar Apr 25 '25 09:04 Carreau

Thanks for taking a look at this!

The "too many #", or comment should start with #- seem like a non issue, and should be ignored in the linter.

Feel free to do as you like, but if it were me, I'd make them just # Heading. or # # Heading. Just to avoid the linter errors.

NeilGirdhar avatar Apr 29 '25 06:04 NeilGirdhar

I believe the point of having 2 #, is if you uncomment the whole file, it is still valid python. oh you make it just a single pound for headers, it is not the case anymore.

Carreau avatar Apr 29 '25 07:04 Carreau

I don't understand? If you uncomment # the following:, that line won't be valid?

NeilGirdhar avatar Apr 29 '25 08:04 NeilGirdhar

Ha you are right. Then I guess it's to distinguish header from description. I guess we could use a different marker for header then, I'm pretty sure a decade ago it was different and made to block comment/ uncomment.

Carreau avatar Apr 29 '25 08:04 Carreau

Sounds great to me

NeilGirdhar avatar Apr 29 '25 09:04 NeilGirdhar