Hi Neale,

The problem with that code in general is that the delayed binding with papi
means that you have to manually ensure that you only reference it *after*
papi has been initialized.  The other alternative is to put them in a
lambda or @property, so they are evaluated at the time of use instead of
when the module is loaded.

On Wed, Dec 2, 2020 at 4:27 AM Neale Ranns (nranns) <nra...@cisco.com>
wrote:

>
>
> Hi Paul,
>
>
>
> Having to write code to conform to python linting is my number 1 annoyance
> when writing tests. This is my usual hack:
>
>   e = VppEnum.vl_api_tunnel_encap_decap_flags_t
>
>   f = e.TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_DSCP
>
>
>
> I support having an auto-linter. I have no knowledge about what’s
> available, so I defer to your choice. All I ask is that it works 😉 i.e.
> you don’t have to pepper code with /* **HERE-BE-DRAGONS** */
>
>
>
> IIUC the plan post 21.01 is to upgrade our default linux distro to 20.04,
> that brings git 2.25 (at least that’s what my VM has, but maybe I put that
> there for recent gerrit up-revs…)
>
>
>
> /neale
>
>
>
> *From: *<vpp-dev@lists.fd.io> on behalf of Paul Vinciguerra <
> pvi...@vinciconsulting.com>
> *Date: *Tuesday 1 December 2020 at 23:56
> *To: *vpp-dev <vpp-dev@lists.fd.io>
> *Subject: *[vpp-dev] replacing make test-checkstyle with black
>
>
>
> I'd like to propose that we make it easier for everyone by adding black
> [0] as a pre-commit hook.  Black will automatically reformat your file to a
> git friendly, pep-8 friendly file.
>
> For those interested in the details, it moves to a line length of 88,
> which helps us out with the lengthy VppEnum names we have.  We can keep it
> at 80 if the community objects.
>
> I can't do anything about:
>
>   /vpp/build-root/build-test/src/test_ipsec_esp.py:504:89: E501 line too
> long (97 > 88 characters)
>
>
>   
> VppEnum.vl_api_tunnel_encap_decap_flags_t.TUNNEL_API_ENCAP_DECAP_FLAG_ENCAP_COPY_DSCP
>
> ;)
>
>
>
> For those who want more details in the changes, see the black code style
> [1]
>
>
>
> Saving time around python linting is the #1 request I have had from the
> community.
>
>
>
> This is a MASSIVE whitespace change.  git blame can ignore whitespace
> changes starting in git 2.23.
>
>
>
> The question is whether the community wants to upgrade their version of
> git to ignore this change with git blame, in exchange for not having to
> manually lint/fix their files.
>
>
>
> Thoughts?
>
>
>
> [0] https://github.com/psf/black
>
> [1] https://github.com/psf/black/blob/master/docs/the_black_code_style.md
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#18220): https://lists.fd.io/g/vpp-dev/message/18220
Mute This Topic: https://lists.fd.io/mt/78647163/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to