From 02abc95c182f8f3f609274cf9d08f7877d025d70 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Tue, 3 Aug 2021 16:14:54 +0200 Subject: [PATCH] Use consistent case for error messages Use the style introduced by @def- in https://github.com/ddnet/ddnet/commit/61e47422f62c8f0c7c4640b6bdeba82b819cc509 --- .github/workflows/style.yml | 9 +++++++++ src/engine/client/backend/opengl/backend_opengl.cpp | 2 +- src/engine/client/client.cpp | 6 +++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml index 0fdd496bb..6a4084ce8 100644 --- a/.github/workflows/style.yml +++ b/.github/workflows/style.yml @@ -36,6 +36,15 @@ jobs: run: scripts/check_dilate.sh release data - name: Shellcheck run: find . -type f -name '*.sh' -print0 | xargs -0 shellcheck + - name: Check log error case + run: | + if grep -Eqr '(msg|Print).*\(.*"[Ee]rror:' src/; + then + echo "[!] Expect log erros to be in this format 'ERROR: error message'" + echo "[!] Found these non uppercased log errors:" + grep -Er '(msg|Print).*\(.*"[Ee]rror:' src/ + exit 1 + fi - name: Pylint run: | pylint --version diff --git a/src/engine/client/backend/opengl/backend_opengl.cpp b/src/engine/client/backend/opengl/backend_opengl.cpp index 352e66422..fcb88e55d 100644 --- a/src/engine/client/backend/opengl/backend_opengl.cpp +++ b/src/engine/client/backend/opengl/backend_opengl.cpp @@ -190,7 +190,7 @@ void CCommandProcessorFragment_OpenGL::SetState(const CCommandBuffer::SState &St } else { - dbg_msg("opengl", "Error: this call should not happen."); + dbg_msg("opengl", "ERROR: this call should not happen."); } } } diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index ff5f9ec82..336f8bfbb 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -3691,7 +3691,7 @@ void CClient::Con_SaveReplay(IConsole::IResult *pResult, void *pUserData) { int Length = pResult->GetInteger(0); if(Length <= 0) - pSelf->m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "replay", "Error: length must be greater than 0 second."); + pSelf->m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "replay", "ERROR: length must be greater than 0 second."); else pSelf->SaveReplay(Length); } @@ -3709,9 +3709,9 @@ void CClient::SaveReplay(const int Length) } if(!DemoRecorder(RECORDER_REPLAYS)->IsRecording()) - m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "replay", "Error: demorecorder isn't recording. Try to rejoin to fix that."); + m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "replay", "ERROR: demorecorder isn't recording. Try to rejoin to fix that."); else if(DemoRecorder(RECORDER_REPLAYS)->Length() < 1) - m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "replay", "Error: demorecorder isn't recording for at least 1 second."); + m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "replay", "ERROR: demorecorder isn't recording for at least 1 second."); else { // First we stop the recorder to slice correctly the demo after