Skip to content

Commit

Permalink
build: use Ubuntu 22.04 for clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
gjasny committed Dec 28, 2023
1 parent 48f75a8 commit 2a39067
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,16 @@ jobs:

format:
name: Clang Format
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout source
uses: actions/checkout@v3

# clang-format comes pre-installed
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
#- name: Install dependencies
# run: |
# sudo apt-get remove -y --purge man-db # avoid time-consuming trigger
# sudo apt-get update
# sudo apt-get install -y clang-format-12
# https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2204-Readme.md

- name: Run clang-format
run: find . -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.cxx' -o -name '*.o' -o -name '*.h' -o -name '*.hpp' -o -name '*.hxx' \) -exec clang-format-12 -style=file -i {} \;
run: find . -type f \( -name '*.c' -o -name '*.cc' -o -name '*.cpp' -o -name '*.cxx' -o -name '*.o' -o -name '*.h' -o -name '*.hpp' -o -name '*.hxx' \) -exec clang-format-15 -style=file -i {} \;

- name: Check for changes
run: git diff --exit-code
6 changes: 4 additions & 2 deletions pull/tests/integration/integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ TEST_F(BasicAuthIntegrationTest, shouldRejectWrongAuthorizationMethod) {

TEST_F(BasicAuthIntegrationTest, shouldRejectMalformedBase64) {
std::unique_ptr<curl_slist, decltype(&curl_slist_free_all)> header(
curl_slist_append(nullptr, "Authorization: Basic $"), curl_slist_free_all);
curl_slist_append(nullptr, "Authorization: Basic $"),
curl_slist_free_all);

fetchPrePerform_ = [&header](CURL* curl) {
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, header.get());
Expand All @@ -286,7 +287,8 @@ TEST_F(BasicAuthIntegrationTest, shouldRejectMalformedBase64) {

TEST_F(BasicAuthIntegrationTest, shouldRejectMalformedBasicAuth) {
std::unique_ptr<curl_slist, decltype(&curl_slist_free_all)> header(
curl_slist_append(nullptr, "Authorization: Basic YWJj"), curl_slist_free_all);
curl_slist_append(nullptr, "Authorization: Basic YWJj"),
curl_slist_free_all);

fetchPrePerform_ = [&header](CURL* curl) {
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, header.get());
Expand Down
2 changes: 1 addition & 1 deletion push/tests/internal/label_encoder_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include <gtest/gtest.h>

#include <string>
#include <sstream>
#include <string>

namespace prometheus {
namespace {
Expand Down

0 comments on commit 2a39067

Please sign in to comment.