Skip to content
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

precommit: check log and error capitalisation #693

Merged
merged 1 commit into from
Jun 10, 2022
Merged

Conversation

corverroos
Copy link
Contributor

Adds pre-commit hooks that checks:

  • log messages are capitalised
  • error messages are not capitalised

category: misc
ticket: none

@corverroos corverroos changed the title pre-commiit: Check log and error capitalisation pre-commiit: check log and error capitalisation Jun 10, 2022
@@ -8,7 +8,7 @@ linters-settings:
default-signifies-exhaustive: true
forbidigo:
forbid:
- 'fmt\.Print.*' # Prevent debug logging
- 'fmt\.Print.*(# Avoid debug logging)?'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forbidigo supports UX messages inside regexp

Copy link
Contributor Author

@corverroos corverroos Jun 10, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forbidigo only supports checking single identifiers. It cannot check function calls with arguments in a single regexp. So had write a custom regexp checker.

@codecov
Copy link

codecov bot commented Jun 10, 2022

Codecov Report

Merging #693 (a0179f4) into main (937835e) will decrease coverage by 0.00%.
The diff coverage is 30.00%.

@@            Coverage Diff             @@
##             main     #693      +/-   ##
==========================================
- Coverage   55.12%   55.11%   -0.01%     
==========================================
  Files         102      102              
  Lines        9911     9899      -12     
==========================================
- Hits         5463     5456       -7     
+ Misses       3662     3653       -9     
- Partials      786      790       +4     
Impacted Files Coverage Δ
core/parsigex/parsigex.go 75.86% <0.00%> (ø)
testutil/beaconmock/options.go 49.10% <0.00%> (ø)
testutil/compose/compose/main.go 0.00% <0.00%> (ø)
testutil/validatormock/validatormock.go 34.80% <0.00%> (ø)
cmd/enr.go 11.76% <100.00%> (ø)
core/scheduler/scheduler.go 73.53% <100.00%> (ø)
app/app.go 58.75% <0.00%> (-1.75%) ⬇️
core/qbft/qbft.go 81.11% <0.00%> (-0.43%) ⬇️
core/consensus/transport.go 63.15% <0.00%> (+2.10%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 937835e...a0179f4. Read the comment docs.

@corverroos corverroos changed the title pre-commiit: check log and error capitalisation precommit: check log and error capitalisation Jun 10, 2022
@corverroos corverroos added the merge when ready Indicates bulldozer bot may merge when all checks pass label Jun 10, 2022
@obol-bulldozer obol-bulldozer bot merged commit f48f1c4 into main Jun 10, 2022
@obol-bulldozer obol-bulldozer bot deleted the corver/regexp branch June 10, 2022 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants