Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
skhaz committed Oct 30, 2023
1 parent e3adae4 commit 3d45278
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Lint

on:
push:
branches:
- main

pull_request:
branches:
- main

jobs:
cpp-linter:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Lint
uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
style: file

- name: Fail Fast
if: steps.linter.outputs.checks-failed > 0
run: exit 1
2 changes: 1 addition & 1 deletion src/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ window::window(std::string_view title, int32_t width, int32_t height, bool fulls
window::operator SDL_Window *() { return _window.get(); }

const std::shared_ptr<renderer> window::create_renderer() const {

Check warning on line 11 in src/window.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

/src/window.cpp:11:1 [readability-const-return-type]

return type 'const std::shared_ptr<renderer>' is 'const'-qualified at the top level, which may reduce code readability without improving const correctness

Check warning on line 11 in src/window.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

/src/window.cpp:11:41 [modernize-use-trailing-return-type]

use a trailing return type for this function
return std::move(std::make_shared<renderer>(&*_window));
return std::make_shared<renderer>(&*_window);
}

0 comments on commit 3d45278

Please sign in to comment.