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

[pre-commit.ci] pre-commit autoupdate #368

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ repos:
name: check .editorconfig rules

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
rev: v19.1.0
hooks:
- id: clang-format

Expand Down
7 changes: 2 additions & 5 deletions cpp-terminal/private/screen.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check notice on line 1 in cpp-terminal/private/screen.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

Run clang-format on cpp-terminal/private/screen.cpp

File cpp-terminal/private/screen.cpp does not conform to Custom style guidelines. (lines 28)

Check notice on line 1 in cpp-terminal/private/screen.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

Run clang-format on cpp-terminal/private/screen.cpp

File cpp-terminal/private/screen.cpp does not conform to Custom style guidelines. (lines 28)
* cpp-terminal
* C++ library for writing multi-platform terminal applications.
*
Expand All @@ -24,12 +24,9 @@
if(GetConsoleScreenBufferInfo(Private::out.handle(), &inf)) return Term::Screen(static_cast<std::size_t>(inf.srWindow.Bottom - inf.srWindow.Top + 1), static_cast<std::size_t>(inf.srWindow.Right - inf.srWindow.Left + 1));
return Term::Screen();
#else
Term::Screen ret;
struct winsize window
{
0, 0, 0, 0
};
Term::Screen ret;
struct winsize window{0, 0, 0, 0};
if(ioctl(Private::out.fd(), TIOCGWINSZ, &window) != -1) ret = {window.ws_row, window.ws_col};

Check warning on line 29 in cpp-terminal/private/screen.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

cpp-terminal/private/screen.cpp:29:31 [misc-include-cleaner]

no header providing "TIOCGWINSZ" is directly included

Check warning on line 29 in cpp-terminal/private/screen.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

cpp-terminal/private/screen.cpp:29:31 [misc-include-cleaner]

no header providing "TIOCGWINSZ" is directly included
return ret;
#endif
}
2 changes: 1 addition & 1 deletion tests/unicode.test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check notice on line 1 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

Run clang-format on tests/unicode.test.cpp

File tests/unicode.test.cpp does not conform to Custom style guidelines. (lines 29)

Check notice on line 1 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

Run clang-format on tests/unicode.test.cpp

File tests/unicode.test.cpp does not conform to Custom style guidelines. (lines 29)
* cpp-terminal
* C++ library for writing multi-platform terminal applications.
*
Expand Down Expand Up @@ -26,25 +26,25 @@
#if defined(_WIN32)
TEST_CASE("to_wide")
{
std::string in((const char*)(u8"∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i)γνωρίζω ἀπὸ τὴν ὄψηდარგებში⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙როგორიცააᚻ∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂᛖᛒᚢᛞᛖразличных\tопеฮั่นเสื่อมโทรมแማደሪያ የለው፥ ግንድ ይዞ ይዞራል።\n")); // Some multi-language charabia
std::string in((const char*)(u8"∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i)γνωρίζω ἀπὸ τὴν ὄψηდარგებში⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙როგორიცააᚻ∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂᛖᛒᚢᛞᛖразличных\tопеฮั่นเสื่อมโทรมแማደሪያ የለው፥ ግንድ ይዞ ይዞራል።\n")); // Some multi-language charabia
std::wstring out{Term::Private::to_wide(in)};
CHECK(out == L"∮ E⋅da = Q, n → ∞, ∑ f(i) = ∏ g(i)γνωρίζω ἀπὸ τὴν ὄψηდარგებში⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙როგორიცააᚻ∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ fi�⑀₂ἠḂᛖᛒᚢᛞᛖразличных\tопеฮั่นเสื่อมโทรมแማደሪያ የለው፥ ግንድ ይዞ ይዞራል።\n");
}
#endif

TEST_CASE("utf32 to utf8")

Check warning on line 35 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:35:1 [misc-use-anonymous-namespace]

function 'DOCTEST_ANON_FUNC_14' declared 'static', move to anonymous namespace instead

Check warning on line 35 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:35:1 [readability-function-cognitive-complexity]

function 'DOCTEST_ANON_FUNC_14' has cognitive complexity of 127 (threshold 25)

Check warning on line 35 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:35:1 [misc-use-anonymous-namespace]

function 'DOCTEST_ANON_FUNC_14' declared 'static', move to anonymous namespace instead

Check warning on line 35 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:35:1 [readability-function-cognitive-complexity]

function 'DOCTEST_ANON_FUNC_14' has cognitive complexity of 127 (threshold 25)
{
char32_t codepoint = U'\u0001';
std::string s{Term::Private::utf32_to_utf8(codepoint)};

Check warning on line 38 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:38:15 [readability-identifier-length]

variable name 's' is too short, expected at least 3 characters

Check warning on line 38 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:38:15 [readability-identifier-length]

variable name 's' is too short, expected at least 3 characters
CHECK(s.size() == 1);

Check warning on line 39 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:39:3 [cppcoreguidelines-avoid-do-while]

avoid do-while loops

Check warning on line 39 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:39:3 [cppcoreguidelines-avoid-do-while]

avoid do-while loops
CHECK(s[0] == '\x01');

Check warning on line 40 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:40:3 [cppcoreguidelines-avoid-do-while]

avoid do-while loops

Check warning on line 40 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:40:3 [cppcoreguidelines-avoid-do-while]

avoid do-while loops
CHECK(s == (const char*)u8"\u0001");

Check warning on line 41 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:41:3 [cppcoreguidelines-avoid-do-while]

avoid do-while loops

Check warning on line 41 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:41:3 [cppcoreguidelines-avoid-do-while]

avoid do-while loops

codepoint = U'\u0080';
s = Term::Private::utf32_to_utf8(codepoint);
CHECK(s.size() == 2);

Check warning on line 45 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:45:3 [cppcoreguidelines-avoid-do-while]

avoid do-while loops

Check warning on line 45 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:45:3 [cppcoreguidelines-avoid-do-while]

avoid do-while loops
CHECK(s[0] == '\xC2');

Check warning on line 46 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:46:3 [cppcoreguidelines-avoid-do-while]

avoid do-while loops

Check warning on line 46 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:46:3 [cppcoreguidelines-avoid-do-while]

avoid do-while loops
CHECK(s[1] == '\x80');

Check warning on line 47 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:47:3 [cppcoreguidelines-avoid-do-while]

avoid do-while loops

Check warning on line 47 in tests/unicode.test.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

tests/unicode.test.cpp:47:3 [cppcoreguidelines-avoid-do-while]

avoid do-while loops
CHECK(s == (const char*)u8"\u0080");

codepoint = U'\u0800';
Expand Down
Loading