[openstack-dev] [hacking] disable a check by default

Ian Cordasco ian.cordasco at RACKSPACE.COM
Fri Feb 20 20:09:14 UTC 2015


On 2/20/15, 12:07, "Ihar Hrachyshka" <ihrachys at redhat.com> wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Hi,
>
>I would like to introduce a hacking check that would be disabled by
>default:
>
>https://review.openstack.org/157894
>
>I see the following commit in flake8:
>
>https://gitlab.com/methane/flake8/commit/b301532636b60683b339a2d081728d229
>57a142f
>
>which suggests it's now possible via specifying entry points in some
>special way. But I fail to determine the proper form to achieve this.
>
>Any ideas?
>
>/Ihar
>-----BEGIN PGP SIGNATURE-----
>Version: GnuPG v1
>
>iQEcBAEBAgAGBQJU53fXAAoJEC5aWaUY1u57XjcIALfx/AgR/69W0ecODiIycQLr
>3IBjj+muKjpMIY8VilNqvO8rR+tm2Z+T87NOkbJdme10GxR1vkfa7ve95GnqZ3XF
>9YAs10Dlc2gxBjL3TWOxJL2pD5reeNOTt3PRWHSW2SdAIfkvypZQRg8oSq2JbloD
>V8/z+PPxLU5hkOmCp5GET1qN+PItvilVZ53LAi/VYIJ3VDON0MKjJeZRXAycCy2k
>HmEPw9by5qyeGLd5w8V3uwDXeGCDkzOovi8VVbnga3DBMUFLSUyXPDdXesGkLeyU
>5mnFrhBxRRZmqjkMlp8C6DzoagFsk4CwFzDk+LM0w/xMlv56CFyGT8zjd4sONcQ=
>=7+do
>-----END PGP SIGNATURE-----

Hey Ihar!

First, the canonical source for Flake8 is actually
https://gitlab.com/pycqa/flake8 (so
https://gitlab.com/pycqa/flake8/commit/b301532636b60683b339a2d081728d22957a
142f is the link that should be used to reference the commit).

As for having a check that is disabled by default, there’s no entry-point
magic here. The check itself that is registered simply needs an
‘off_by_default’ attribute defined and set to the value ‘True’. I believe
hacking was looking at adding a decorator to do this for check authors,
perhaps Joe (Gordon) can give you more details about that.

Cheers,
Ian



More information about the OpenStack-dev mailing list