-
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?
Changes from all commits
dbfc6e7
fcaafe1
9bb9bd9
975f3c3
89506dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json | ||
version: 0.2 | ||
|
||
import: | ||
- "@cspell/dict-golang/cspell-ext.json" | ||
- "@cspell/dict-python/cspell-ext.json" | ||
- "@cspell/dict-lua/cspell-ext.json" | ||
- "@cspell/dict-cpp/cspell-ext.json" | ||
- "@cspell/dict-markdown/cspell-ext.json" | ||
- "@cspell/dict-ru_ru/cspell-ext.json" | ||
- "@cspell/dict-software-terms/cspell-ext.json" | ||
|
||
language: "en,ru" | ||
|
||
dictionaryDefinitions: | ||
- name: project-words | ||
path: .cspell_project-words.txt | ||
description: Words used in this project | ||
addWords: true | ||
|
||
dictionaries: | ||
- project-words | ||
# List of type dependent dictionaries to use with any file types. | ||
- golang | ||
- python | ||
- lua | ||
- cpp | ||
|
||
ignoreRegExpList: | ||
- ^\s+(\w+\s+)?"github.com/.*" # Ignore Go import paths. | ||
- -D[A-Z\d_]+ # Ignore CMake flags "-DFLAG_NAME". | ||
- \d+-g[a-f\d]{4,} # Ignore git commit hashes in version string. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,68 @@ | ||
catridge | ||
cli | ||
coredump | ||
distfiles | ||
dpkg | ||
etcdctl | ||
*cmd* | ||
+cli | ||
+ctl | ||
+s | ||
addfinalizer | ||
aeon* | ||
autoexpel | ||
bootstrapper | ||
ccluster | ||
clientv3 | ||
clustercmd | ||
commentf | ||
containsf | ||
debugf | ||
demoter | ||
disbalance | ||
distfile* | ||
drwxr | ||
equalf | ||
errf | ||
etcd* | ||
etcdserver | ||
evaler | ||
getenv | ||
falsef | ||
finalizer* | ||
flightrec | ||
getfixturevalue | ||
golangci | ||
Infof | ||
iproto | ||
isort | ||
logfile | ||
incdir | ||
infof | ||
leaderuuid | ||
libcluster | ||
luabody | ||
luajit | ||
luakit | ||
luarocks | ||
MAKEFLAGS | ||
mapstructure | ||
memtx | ||
myapp | ||
packignore | ||
pidfile | ||
postinst | ||
preinst | ||
mvcc | ||
mvccpb | ||
nilf | ||
nodeps | ||
nogc | ||
nolint | ||
notarantool | ||
promptui | ||
protoc | ||
pytest | ||
rebootstrap | ||
replicaset | ||
replicasets | ||
rocks | ||
rockspec | ||
replicaset* | ||
rockspec* | ||
rpmdeb | ||
specialchars | ||
sslcafile | ||
sslcertfile | ||
sslciphers | ||
sslkeyfile | ||
stateboard | ||
Svacer | ||
tarantool | ||
tarantoolctl | ||
tarantools | ||
tcm | ||
testdata | ||
testfull | ||
TNTP | ||
ttable | ||
venv | ||
svacer | ||
tarantool* | ||
tlsdialer | ||
tmpl | ||
tnt+ | ||
tntp | ||
trimprefix | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. See, comment about |
||
truef | ||
vshard | ||
Warnf | ||
xlog | ||
xlogs | ||
vylog | ||
warnf | ||
xcall | ||
xlog* |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,12 +25,12 @@ runs: | |
echo "Found base branch with hash: '${HASH}'" | ||
echo "BASE_BRANCH=${HASH}" >> ${GITHUB_ENV} | ||
|
||
- name: pre-commit checks (diff) | ||
uses: pre-commit/[email protected] | ||
env: | ||
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 commentThe 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 commentThe 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. |
||
# uses: pre-commit/[email protected] | ||
# env: | ||
# SKIP: golangci-lint-full | ||
# with: | ||
# extra_args: --all-files --from-ref=${{ env.BASE_BRANCH }} --to-ref=HEAD --hook-stage=manual | ||
|
||
- name: pre-commit checks (full) | ||
uses: pre-commit/[email protected] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,47 +23,40 @@ repos: | |
files: ".cspell_project-words.txt" | ||
args: [--ignore-case, --unique] | ||
|
||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.4.1 | ||
hooks: | ||
- id: codespell | ||
name: "Check for common misspellings" | ||
stages: [pre-commit, manual] | ||
types_or: [go, python, lua] | ||
additional_dependencies: | ||
- tomli | ||
|
||
- repo: https://github.com/streetsidesoftware/cspell-cli | ||
rev: v9.0.1 | ||
rev: v9.1.0 | ||
hooks: | ||
- id: cspell | ||
name: "Spell-checking documentation files" | ||
stages: [pre-commit, manual] | ||
args: | ||
[--config=.cspell-precommit.json, --show-context, --show-suggestions] | ||
types_or: [markdown] | ||
name: "Spell checking commit message" | ||
stages: [commit-msg] | ||
args: [--config=.cspell.yaml, --show-context, --show-suggestions] | ||
additional_dependencies: | ||
- "@cspell/dict-markdown" | ||
- "@cspell/dict-ru_ru" | ||
- "@cspell/dict-golang" | ||
- "@cspell/dict-python" | ||
- "@cspell/dict-lua" | ||
- "@cspell/dict-cpp" | ||
- "@cspell/dict-software-terms" | ||
|
||
- id: cspell | ||
name: "Spell-checking commit message" | ||
stages: [commit-msg] | ||
args: | ||
[--config=.cspell-precommit.json, --show-context, --show-suggestions] | ||
name: "Spell checking source files" | ||
stages: [pre-commit, manual] | ||
args: [--config=.cspell.yaml, --show-context, --show-suggestions] | ||
types_or: [go, python, markdown] | ||
exclude: | | ||
(?x)^( | ||
.*\.pb.go| | ||
.*/third_party/.* | ||
)$ | ||
additional_dependencies: | ||
- "@cspell/dict-markdown" | ||
- "@cspell/dict-ru_ru" | ||
# TODO: add words from [.go, .py] with "errors" to `.cspell_project-words.txt` (#TNTP-3105). | ||
# - id: cspell | ||
# name: "Py: Spell check files" | ||
# types: [python] | ||
# additional_dependencies: | ||
# - "@cspell/dict-python" | ||
# - id: cspell | ||
# name: "Go: Spell check files" | ||
# types: [go] | ||
# additional_dependencies: | ||
# - "@cspell/dict-golang" | ||
- "@cspell/dict-golang" | ||
- "@cspell/dict-python" | ||
- "@cspell/dict-lua" | ||
- "@cspell/dict-cpp" | ||
- "@cspell/dict-software-terms" | ||
|
||
- repo: local | ||
hooks: | ||
|
@@ -88,7 +81,7 @@ repos: | |
args: [--max-len=100, --tab-len=4, --no-reformat-tags] | ||
|
||
- repo: https://github.com/golangci/golangci-lint | ||
rev: v2.1.6 | ||
rev: v2.2.2 | ||
hooks: | ||
- id: golangci-lint | ||
name: "Go: verify sources" | ||
|
@@ -102,7 +95,6 @@ repos: | |
- id: golangci-lint-full | ||
name: "Go: verify all sources (CI)" | ||
description: Checking all Go sources. | ||
pass_filenames: false | ||
always_run: true | ||
stages: [manual] | ||
args: [--config=golint-precommit-ci.yml, --allow-parallel-runners] | ||
|
@@ -113,8 +105,8 @@ repos: | |
language: golang | ||
types: [go] | ||
name: "Go: verify sources diff (CI)" | ||
description: Checking only fresh changes, added to the PR. | ||
stages: [manual] | ||
pass_filenames: false | ||
always_run: true | ||
entry: >- | ||
bash -c "golangci-lint run --new-from-rev=${BASE_BRANCH:-master} | ||
|
@@ -123,16 +115,16 @@ repos: | |
- github.com/golangci/golangci-lint/v2/cmd/[email protected] | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.12.0 | ||
rev: v0.12.2 | ||
hooks: | ||
- id: ruff-check | ||
name: "Py: Run the linter" | ||
args: [--fix] | ||
- id: ruff-format | ||
name: "Py: Run the formatter" | ||
stages: [pre-commit, manual] | ||
files: test/.*\.py$ | ||
|
||
- id: ruff-format | ||
name: "Py: Run the formatter" | ||
- id: ruff-check | ||
name: "Py: Run the linter" | ||
args: [--fix] | ||
stages: [pre-commit, manual] | ||
files: test/.*\.py$ | ||
|
||
|
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.