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

test rate-limits branch #33

Closed
wants to merge 8 commits into from
Closed
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
15 changes: 9 additions & 6 deletions .github/workflows/cpp-lint-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: cpp-linter as action
on:
workflow_dispatch:
workflow_call:
# pull_request:


jobs:
Expand Down Expand Up @@ -32,27 +33,29 @@ jobs:
run: mkdir build && cmake -Bbuild src

- name: Run linter as action
uses: cpp-linter/cpp-linter-action@latest
uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: file
files-changed-only: false
files-changed-only: true
lines-changed-only: true
# to ignore all build folder contents
ignore: build
database: build
verbosity: 9
# verbosity: debug
version: ${{ matrix.clang-version }}
thread-comments: ${{ matrix.clang-version == '12' }}
file-annotations: ${{ matrix.clang-version == '12' }}
thread-comments: ${{ matrix.clang-version == '16' }}
file-annotations: ${{ matrix.clang-version == '16' }}
extra-args: -std=c++14 -Wall
tidy-review: ${{ matrix.clang-version == '16' }}
# format-review: ${{ matrix.clang-version == '16' }}

- name: Fail fast?!
# if: steps.linter.outputs.checks-failed > 0
run: |
echo "some linter checks failed"
echo "${{ steps.linter.outputs.checks-failed }}"
echo "${{ env.checks-failed }}"
# for actual deployment
# run: exit 1
30 changes: 17 additions & 13 deletions .github/workflows/cpp-lint-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ on:
description: 'which branch to test'
default: 'main'
required: true
pull_request:
push:

jobs:
cpp-linter:
runs-on: windows-latest

strategy:
matrix:
clang-version: ['7', '8', '9','10', '11', '12', '13', '14', '15', '16', '17']
clang-version: ['10', '11', '12', '13', '14', '15', '16', '17']
repo: ['cpp-linter/cpp-linter']
branch: ['${{ inputs.branch }}']
branch: ['rate-limits'] # ['${{ inputs.branch }}']
fail-fast: false

steps:
Expand All @@ -42,7 +44,7 @@ jobs:

- name: Cache the build artifacts
id: cache-build
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: build
key: ${{ hashFiles('src/CMakeLists.txt', 'src/demo.cpp', 'src/demo.hpp') }}
Expand All @@ -56,16 +58,18 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >
cpp-linter
-s=file
-v=9
-i=build
-p=build
-V=${{ runner.temp }}/llvm
-f=false
--extra-arg="-std=c++14 -Wall"
--thread-comments=${{ matrix.clang-version == '12' }}
-a=${{ matrix.clang-version == '12' }}
cpp-linter
--style=file
--verbosity=debug
--ignore=build
--database=build
--version=${{ runner.temp }}/llvm
--files-changed-only=true
--lines-changed-only=false
--extra-arg="-std=c++14 -Wall"
--thread-comments=${{ matrix.clang-version == '16' && 'update' }}
--file-annotations=${{ matrix.clang-version == '16' }}
--tidy-review=${{ matrix.clang-version == '16' }}

- name: Fail fast?!
if: steps.linter.outputs.checks-failed > 0
Expand Down
21 changes: 11 additions & 10 deletions src/demo.cpp
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
/** This is a very ugly test code (doomed to fail linting) */

Check notice on line 1 in src/demo.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter (16, cpp-linter/cpp-linter, rate-limits)

Run clang-format on src/demo.cpp

File src/demo.cpp does not conform to Custom style guidelines. (lines 3, 8, 10, 13, 18)
#include "demo.hpp"
#include <cstdio>
#include <cstddef>
#include <stdio.h>

Check warning on line 3 in src/demo.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter (16, cpp-linter/cpp-linter, rate-limits)

src/demo.cpp:3:10 [modernize-deprecated-headers]

inclusion of deprecated C++ header 'stdio.h'; consider using 'cstdio' instead
2bndy5 marked this conversation as resolved.
Show resolved Hide resolved
2bndy5 marked this conversation as resolved.
Show resolved Hide resolved

// using size_t from cstddef
size_t dummyFunc(size_t i) { return i; }

2bndy5 marked this conversation as resolved.
Show resolved Hide resolved
2bndy5 marked this conversation as resolved.
Show resolved Hide resolved
int main()
{
for (;;)
break;


int main(){

Check warning on line 8 in src/demo.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter (16, cpp-linter/cpp-linter, rate-limits)

src/demo.cpp:8:5 [modernize-use-trailing-return-type]

use a trailing return type for this function

for (;;) break;

Check warning on line 10 in src/demo.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter (16, cpp-linter/cpp-linter, rate-limits)

src/demo.cpp:10:13 [readability-braces-around-statements]

statement should be inside braces

2bndy5 marked this conversation as resolved.
Show resolved Hide resolved
2bndy5 marked this conversation as resolved.
Show resolved Hide resolved

printf("Hello world!\n");

Check warning on line 13 in src/demo.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter (16, cpp-linter/cpp-linter, rate-limits)

src/demo.cpp:13:5 [cppcoreguidelines-pro-type-vararg]

do not call c-style vararg functions
2bndy5 marked this conversation as resolved.
Show resolved Hide resolved
2bndy5 marked this conversation as resolved.
Show resolved Hide resolved

return 0;
}



return 0;}
2bndy5 marked this conversation as resolved.
Show resolved Hide resolved
2bndy5 marked this conversation as resolved.
Show resolved Hide resolved
11 changes: 3 additions & 8 deletions src/demo.hpp
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
#pragma once

Check notice on line 1 in src/demo.hpp

View workflow job for this annotation

GitHub Actions / cpp-linter (16, cpp-linter/cpp-linter, rate-limits)

Run clang-format on src/demo.hpp

File src/demo.hpp does not conform to Custom style guidelines. (lines 1, 8, 11, 12, 31, 34)



class Dummy {
char* useless;

Check warning on line 6 in src/demo.hpp

View workflow job for this annotation

GitHub Actions / cpp-linter (16, cpp-linter/cpp-linter, rate-limits)

src/demo.hpp:6:11 [modernize-use-default-member-init]

use default member initializer for 'useless'
int numb;

Check warning on line 7 in src/demo.hpp

View workflow job for this annotation

GitHub Actions / cpp-linter (16, cpp-linter/cpp-linter, rate-limits)

src/demo.hpp:7:9 [modernize-use-default-member-init]

use default member initializer for 'numb'
Dummy() :numb(0), useless("\0"){}
2bndy5 marked this conversation as resolved.
Show resolved Hide resolved
2bndy5 marked this conversation as resolved.
Show resolved Hide resolved

public:
void *not_usefull(char *str){
useless = str;
return 0;
}
void *not_useful(char *str){useless = str;}

Check warning on line 11 in src/demo.hpp

View workflow job for this annotation

GitHub Actions / cpp-linter (16, cpp-linter/cpp-linter, rate-limits)

src/demo.hpp:11:11 [modernize-use-trailing-return-type]

use a trailing return type for this function
2bndy5 marked this conversation as resolved.
Show resolved Hide resolved
2bndy5 marked this conversation as resolved.
Show resolved Hide resolved
};


Expand All @@ -28,14 +26,11 @@









struct LongDiff
{

long diff;

};