Skip to content

Ignore W503 on flake8

Ronan Lefol requested to merge flake8_W503 into develop

Added a new ignore rule on flake8, W503 where it wants no linebreak before binary operator. This goes against PEP8.

Additionally add comments justifying each ignore (for easier future understanding)

Example: original:

return self.Lambda * (self._GL(r, theta) / self._GL0) * self.gL.interp(r=r) * self.F.interp(r=r, theta=theta)

will be converted (by black) to:

return (
            self.Lambda
            * (self._GL(r, theta) / self._GL0)
            * self.gL.interp(r=r)
            * self.F.interp(r=r, theta=theta)
        )

whereas W503 wants us to have:

return (
            self.Lambda *
            (self._GL(r, theta) / self._GL0) *
            self.gL.interp(r=r) *
            self.F.interp(r=r, theta=theta)
        )

See also: https://github.com/psf/black/issues/43

PEP8 initially recommended breaking after an operator, but adjusted to the now accepted before

Merge request reports

Loading