Skip to content

Commit

Permalink
cleaning up + reworked clang tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
koniarik committed Jan 27, 2024
1 parent 4958dc3 commit ea80486
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 27 deletions.
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ test: build_test
clean:
rm -rf ./build

build_test:
configure:
cmake -Bbuild/norm $(EXTRAARGS)

build_test: configure
cmake --build build/norm

build_coverage:
Expand All @@ -29,9 +31,8 @@ run_coverage: build_coverage
coverage: run_coverage
gcovr --decisions --calls -p --html-details -o build/cov/index.html -r .

clang-tidy:
cmake -Bbuild/clang-tidy -DEMLABCPP_TESTS_ENABLED=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_CXX_CLANG_TIDY=clang-tidy
cmake --build build/clang-tidy
clang-tidy: configure
find src/ include/ \( -iname "*.hpp" -or -iname "*.cpp" \) -print0 | parallel -0 clang-tidy -p build/norm {}

clang-format:
find ./ \( -iname "*.h" -o -iname "*.cpp" \) | xargs clang-format -i
Expand Down
4 changes: 2 additions & 2 deletions include/emlabcpp/experimental/string_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ void to_json( nlohmann::json& j, const string_buffer< N >& buffer )
template < std::size_t N >
void from_json( const nlohmann::json& j, string_buffer< N >& buffer )
{
std::string s = j;
buffer = string_buffer< N >( std::string_view{ s } );
const std::string s = j;
buffer = string_buffer< N >( std::string_view{ s } );
}

#endif
Expand Down
2 changes: 1 addition & 1 deletion include/emlabcpp/protocol/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ void from_json( const nlohmann::json& j, message< N >& msg )
throw std::exception{}; // TODO: fix this

std::vector< std::byte > tmp;
for ( std::byte b : j )
for ( const std::byte b : j )
tmp.push_back( b );

msg = message< N >{ view< const std::byte* >( tmp ) };
Expand Down
2 changes: 1 addition & 1 deletion scripts/copyright-header-run.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# Requires: https://github.com/cloudposse/copyright-header

copyright-header --license MIT --copyright-software emlabcpp --copyright-holder "Jan Veverak Koniarik" --copyright-year "2020" --copyright-software-description "Embedded library" --word-wrap 100 --guess-extension --syntax ./scripts/copyright-header-syntax.yml --add-path src:include:examples:tests:cmake --output-dir ./
copyright-header --license MIT --copyright-software emlabcpp --copyright-holder "Jan Veverak Koniarik" --copyright-year "2023" --copyright-software-description "Embedded library" --word-wrap 100 --guess-extension --syntax ./scripts/copyright-header-syntax.yml --add-path src:include:examples:tests:cmake --output-dir ./
19 changes: 0 additions & 19 deletions sonar-project.properties

This file was deleted.

0 comments on commit ea80486

Please sign in to comment.