Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,11 @@ repos:
- id: vale-sync
name: vale sync (download styles)
language: golang
# The vale module root carries no Go package (the binary lives under cmd/vale), so a go
# install of the bare module fails and aborts the whole pre-commit run before any hook
# fires.
additional_dependencies:
- 'github.com/errata-ai/vale/v3@v3.14.2'
- 'github.com/errata-ai/vale/v3/cmd/vale@v3.14.2'
entry: vale sync
files: ^(docs/|\.vale\.ini$)
pass_filenames: false
Expand Down Expand Up @@ -224,22 +227,32 @@ repos:

- id: check-categorized-logging
name: Check for category function passed to uncategorized logging macro
entry: bash -c 'if grep -EnH "(^|[^A-Za-z0-9_])q(Debug|Info|Warning|Critical)\([[:space:]]*[A-Za-z_]+Log[[:space:]]*\)" "$@" 2>/dev/null; then echo "::error::Category function passed to qDebug/qInfo/qWarning/qCritical. Use the qCDebug/qCInfo/qCWarning/qCCritical macros instead." >&2; exit 1; fi' --
entry: >-
bash -c 'if grep -EnH "(^|[^A-Za-z0-9_])q(Debug|Info|Warning|Critical)\([[:space:]]*[A-Za-z_]+Log[[:space:]]*\)" "$@" 2>/dev/null;
then echo "::error::Category function passed to qDebug/qInfo/qWarning/qCritical.
Use the qCDebug/qCInfo/qCWarning/qCCritical macros instead." >&2; exit 1; fi' --
language: system
types: [c++]
pass_filenames: true

- id: check-no-qtest-ignore-message
name: Check for QTest::ignoreMessage in test code
entry: bash -c 'if grep -nH "QTest::ignoreMessage" "$@" 2>/dev/null; then echo "::error::QTest::ignoreMessage found. Use expectLogMessage+verifyExpectedLogMessage or ignoreLogMessage instead." >&2; exit 1; fi' --
entry: >-
bash -c 'if grep -nH "QTest::ignoreMessage" "$@" 2>/dev/null;
then echo "::error::QTest::ignoreMessage found.
Use expectLogMessage+verifyExpectedLogMessage or ignoreLogMessage instead." >&2; exit 1; fi' --
language: system
types: [c++]
files: ^test/
pass_filenames: true

- id: check-no-fixed-qwait
name: Check for fixed-delay QTest::qWait in test code
entry: bash -c 'if grep -EnH "qWait\([1-9][0-9]*\)" "$@" 2>/dev/null; then echo "::error::QTest::qWait(<non-zero>) found. Use QTRY_VERIFY_WITH_TIMEOUT, QTRY_COMPARE_WITH_TIMEOUT, or QSignalSpy::wait with a TestTimeout::* constant instead." >&2; exit 1; fi' --
entry: >-
bash -c 'if grep -EnH "qWait\([1-9][0-9]*\)" "$@" 2>/dev/null;
then echo "::error::QTest::qWait(<non-zero>) found.
Use QTRY_VERIFY_WITH_TIMEOUT, QTRY_COMPARE_WITH_TIMEOUT,
or QSignalSpy::wait with a TestTimeout::* constant instead." >&2; exit 1; fi' --
language: system
types: [c++]
files: ^test/
Expand Down
Loading