[
https://issues.apache.org/jira/browse/CASSANDRA-16849?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ruslan Fomkin updated CASSANDRA-16849:
--------------------------------------
Description:
The [contributing page of
cassandra-test|https://github.com/apache/cassandra-dtest/blob/trunk/CONTRIBUTING.md]
contains instructions to setup git hook to run flake8 on commit:
{code:java}
flake8 --install-hook
git config flake8.strict true
git config flake8.ignore E501,F811,F812,F821,F822,F823,F831,F841,N8,C9
{code}
I insulted flake8 and followed the instruction and after I committed changes to
{{conftest.py}}, I've got many E501 errors:
{code:java}
conftest.py:21:80: E501 line too long (85 > 79 characters)
conftest.py:31:80: E501 line too long (98 > 79 characters)
conftest.py:32:80: E501 line too long (96 > 79 characters)
conftest.py:33:80: E501 line too long (96 > 79 characters)
conftest.py:34:80: E501 line too long (96 > 79 characters)
conftest.py:35:80: E501 line too long (90 > 79 characters)
conftest.py:39:80: E501 line too long (85 > 79 characters)
...{code}
This means that the ignore configuration is not used, and I don't see if there
is any workaround except removing the commit hook manually.
According to flake8 documentation the instructions are applicable to an old
version of flake8, e.g, [2.6.0|https://flake8.pycqa.org/en/2.6.0/vcs.html].
This page doesn't exist in the latest version of flake8. The latest
documentation has
[instructions|https://flake8.pycqa.org/en/3.9.2/user/using-hooks.html?highlight=hooks],
which suggests to use [pre-commit package|https://pre-commit.com/], and
doesn't recommend to use the old way, since it is not tested well.
Will it be good idea to update instructions?
was:
The [contributing page of
cassandra-test|https://github.com/apache/cassandra-dtest/blob/trunk/CONTRIBUTING.md]
contains instructions to setup git hook to run flake8 on commit:
{code:java}
flake8 --install-hook
git config flake8.strict true
git config flake8.ignore E501,F811,F812,F821,F822,F823,F831,F841,N8,C9
{code}
I insulted flake8 and followed the instruction and after I committed changes to
{{conftest.py}}, I've got many E501 errors:
{code:java}
conftest.py:21:80: E501 line too long (85 > 79 characters)
conftest.py:31:80: E501 line too long (98 > 79 characters)
conftest.py:32:80: E501 line too long (96 > 79 characters)
conftest.py:33:80: E501 line too long (96 > 79 characters)
conftest.py:34:80: E501 line too long (96 > 79 characters)
conftest.py:35:80: E501 line too long (90 > 79 characters)
conftest.py:39:80: E501 line too long (85 > 79 characters)
...{code}
This means that the ignore configuration is not used, and I don't see if there
is any workaround except removing the commit hook manually.
According to flake8 documentation the instructions are applicable to an old
version of flake8, e.g, [2.6.0|https://flake8.pycqa.org/en/2.6.0/vcs.html].
This page doesn't exist in the latest version of flake8. The latest
documentation has
[instructions|https://flake8.pycqa.org/en/3.9.2/user/using-hooks.html?highlight=hooks]
to use [pre-commit package|https://pre-commit.com/].
It will be great to fix the documentation and be specific about flake8 version
or update instructions according the current version or both.
> Following documentation for setting flake8 hook in dtests breaks environment
> ----------------------------------------------------------------------------
>
> Key: CASSANDRA-16849
> URL: https://issues.apache.org/jira/browse/CASSANDRA-16849
> Project: Cassandra
> Issue Type: Improvement
> Components: Test/dtest/python
> Reporter: Ruslan Fomkin
> Priority: Normal
>
> The [contributing page of
> cassandra-test|https://github.com/apache/cassandra-dtest/blob/trunk/CONTRIBUTING.md]
> contains instructions to setup git hook to run flake8 on commit:
>
> {code:java}
> flake8 --install-hook
> git config flake8.strict true
> git config flake8.ignore E501,F811,F812,F821,F822,F823,F831,F841,N8,C9
> {code}
> I insulted flake8 and followed the instruction and after I committed changes
> to {{conftest.py}}, I've got many E501 errors:
>
>
> {code:java}
> conftest.py:21:80: E501 line too long (85 > 79 characters)
> conftest.py:31:80: E501 line too long (98 > 79 characters)
> conftest.py:32:80: E501 line too long (96 > 79 characters)
> conftest.py:33:80: E501 line too long (96 > 79 characters)
> conftest.py:34:80: E501 line too long (96 > 79 characters)
> conftest.py:35:80: E501 line too long (90 > 79 characters)
> conftest.py:39:80: E501 line too long (85 > 79 characters)
> ...{code}
> This means that the ignore configuration is not used, and I don't see if
> there is any workaround except removing the commit hook manually.
> According to flake8 documentation the instructions are applicable to an old
> version of flake8, e.g, [2.6.0|https://flake8.pycqa.org/en/2.6.0/vcs.html].
> This page doesn't exist in the latest version of flake8. The latest
> documentation has
> [instructions|https://flake8.pycqa.org/en/3.9.2/user/using-hooks.html?highlight=hooks],
> which suggests to use [pre-commit package|https://pre-commit.com/], and
> doesn't recommend to use the old way, since it is not tested well.
> Will it be good idea to update instructions?
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]