[oslo] fix flake8-hacking inconsistences on xena/wallaby

Sorin Sbarnea ssbarnea at redhat.com
Tue Mar 30 09:42:25 UTC 2021


This is all is needed to make hacking being directly consumable by
pre-commit (tool, not git hook):
https://review.opendev.org/c/openstack/hacking/+/783820

I already did some tests and it worked fine, that is how I made bashate and
doc8 long time ago:

https://github.com/openstack/bashate/blob/master/.pre-commit-hooks.yaml
https://github.com/PyCQA/doc8/blob/master/.pre-commit-hooks.yaml

Once that is merged and released, you could replace the normal flake8 usage
inside your repo .pre-commit-config.yaml file:

- repo: https://review.opendev.org/openstack/hacking
  rev: 4.1.0  # or whatever release number we will pick
  hooks:
    - id: hacking

If you want to add your own extra plugins you can still do it using the
additional_dependencies key.

--
/zbr


On 24 Mar 2021 at 16:34:09, Herve Beraud <hberaud at redhat.com> wrote:

>
>
> Le mer. 24 mars 2021 à 17:13, Jeremy Stanley <fungi at yuggoth.org> a écrit :
>
>> On 2021-03-24 05:44:59 -0700 (-0700), Sorin Sbarnea wrote:
>> [...]
>> > If we still have a strong case for using hacking, I think it
>> > should be converted to be usable as a hook itself, one that calls
>> > flake8.
>> [...]
>>
>> Can you expand on how you would expect that to work? Quoting from
>> hacking's README:
>>
>>     "hacking is a set of flake8 plugins that test and enforce the
>>     OpenStack StyleGuide"
>>
>> How would you turn a set of flake8 plugins into a pre-commit hook
>> which calls flake8? That seems rather circular.
>>
>
> Excellent point!
>
> --
>> Jeremy Stanley
>>
>
>
> --
> Hervé Beraud
> Senior Software Engineer at Red Hat
> irc: hberaud
> https://github.com/4383/
> https://twitter.com/4383hberaud
> -----BEGIN PGP SIGNATURE-----
>
> wsFcBAABCAAQBQJb4AwCCRAHwXRBNkGNegAALSkQAHrotwCiL3VMwDR0vcja10Q+
> Kf31yCutl5bAlS7tOKpPQ9XN4oC0ZSThyNNFVrg8ail0SczHXsC4rOrsPblgGRN+
> RQLoCm2eO1AkB0ubCYLaq0XqSaO+Uk81QxAPkyPCEGT6SRxXr2lhADK0T86kBnMP
> F8RvGolu3EFjlqCVgeOZaR51PqwUlEhZXZuuNKrWZXg/oRiY4811GmnvzmUhgK5G
> 5+f8mUg74hfjDbR2VhjTeaLKp0PhskjOIKY3vqHXofLuaqFDD+WrAy/NgDGvN22g
> glGfj472T3xyHnUzM8ILgAGSghfzZF5Skj2qEeci9cB6K3Hm3osj+PbvfsXE/7Kw
> m/xtm+FjnaywZEv54uCmVIzQsRIm1qJscu20Qw6Q0UiPpDFqD7O6tWSRKdX11UTZ
> hwVQTMh9AKQDBEh2W9nnFi9kzSSNu4OQ1dRMcYHWfd9BEkccezxHwUM4Xyov5Fe0
> qnbfzTB1tYkjU78loMWFaLa00ftSxP/DtQ//iYVyfVNfcCwfDszXLOqlkvGmY1/Y
> F1ON0ONekDZkGJsDoS6QdiUSn8RZ2mHArGEWMV00EV5DCIbCXRvywXV43ckx8Z+3
> B8qUJhBqJ8RS2F+vTs3DTaXqcktgJ4UkhYC2c1gImcPRyGrK9VY0sCT+1iA+wp/O
> v6rDpkeNksZ9fFSyoY2o
> =ECSj
> -----END PGP SIGNATURE-----
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-discuss/attachments/20210330/4b422028/attachment-0001.html>


More information about the openstack-discuss mailing list