-
Notifications
You must be signed in to change notification settings - Fork 15
spell: turn on pre-commit auto spell checker #1184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
370cdba
to
c04ce9f
Compare
2b4a206
to
59e26ec
Compare
b4547b7
to
20a96d7
Compare
SKIP: golangci-lint-full | ||
with: | ||
extra_args: --all-files --from-ref=${{ env.BASE_BRANCH }} --to-ref=HEAD --hook-stage=manual | ||
# - name: pre-commit checks (diff) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking “all” files (including old code) is done with lightened requirements, but even this required minor changes. However, any changes are treated as “new” code. The purpose of this PR is to enable rules, not to fix problems in old code.
The step that is turned off here is just checking for changes to the code. Since any new code is checked under stricter rules.
equalf | ||
errf | ||
etcd* | ||
etcdserver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks unnecessary as previous entry matches it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it doesn't work that way.
XXX*
can be joined only with *YYY
patterns.
tlsdialer | ||
tmpl | ||
tnt+ | ||
tntp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks unnecessary as previous entry matches it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See, comment about etcd*
lib/cluster/integration_test.go
Outdated
@@ -145,7 +145,7 @@ func startEtcd(t *testing.T, opts etcdOpts) integration.LazyCluster { | |||
func etcdPut(t *testing.T, etcd *clientv3.Client, key, value string) { | |||
t.Helper() | |||
var ( | |||
presp *clientv3.PutResponse | |||
presp *clientv3.PutResponse // spell-checker:ignore presp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In 'cli/cluster/integration_test.go' the same identifier changed to pResp
. Please consider single approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pResp
@@ -273,10 +273,10 @@ func TestConnectEtcd(t *testing.T) { | |||
etcdPut(t, etcd, "foo", "bar") | |||
|
|||
ctx, cancel := context.WithTimeout(context.Background(), timeout) | |||
gresp, err := etcd.Get(ctx, "foo") | |||
resp, err := etcd.Get(ctx, "foo") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In 'cli/cluster/integration_test.go' the similar identifier presp
changed to pResp
. Please consider similar approach here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What will the letter p
in this variable mean?
I don't see the need for it in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the similar approach I mean that if presp
is changed to pResp
then gresp
should be changed to gResp
(AFAIU pResp stands for PUT response and gResp
stands for GET response).
lib/cluster/etcd.go
Outdated
@@ -502,6 +502,7 @@ func (publisher EtcdAllDataPublisher) Publish(revision int64, data []byte) error | |||
txn = txn.If(cmps...) | |||
} | |||
|
|||
// spell-checker:ignore tresp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In 'cli/cluster/integration_test.go' the similar identifier presp
changed to pResp
. Please consider similar approach here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tResp
@@ -155,7 +155,7 @@ def test_promote_cconfig_failovers( | |||
"manual-failover-2", | |||
"election-failover-1", | |||
"election-failover-2", | |||
"eleciton-failover-3", | |||
"eleciton-failover-3", # spell-checker:disable-line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"eleciton-failover-3", # spell-checker:disable-line | |
"election-failover-3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the test will fail in this case.
The purpose of this PR is not to fix problematic code, but to enable spell checking.
@@ -44,7 +46,7 @@ def skip_no_helpers(request: pytest.FixtureRequest, completion: Completion) -> N | |||
|
|||
|
|||
def pytest_configure(config): | |||
config.addinivalue_line( | |||
config.addinivalue_line( # cSpell:words addinivalue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's possible I'd suggest to introduce separate project-words file for integration tests directory. All pytest identifiers that are currently in use could be listed there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My opinion is that lists of “bad” words are workaround, because they should not exist. The fact that now a list of words is made at the project level is because there are too many such words already found throughout the old code. Ideally, the names should immediately meet the requirements of the checker.
And such marks raise a “red” flag - that something needs to be done here with refactoring. The word list on other hand hides this problem.
20a96d7
to
707afff
Compare
Closes #TNTP-3105
Part of #TNTP-3105
707afff
to
25a4d6e
Compare
Part of #TNTP-3105
Part of #TNTP-3105
Due to formatting changes, it triggers the linter's errors. FIXME: turn on the checking with the following PR. Part of #TNTP-3105
25a4d6e
to
89506dd
Compare
Turning on automatic static code analyzer: check words misspell for code files.
Closes #TNTP-3105
Come with second part in #1185