mirror of
				https://github.com/XRPLF/clio.git
				synced 2025-11-04 11:55:51 +00:00 
			
		
		
		
	@@ -26,12 +26,12 @@ sources="src tests"
 | 
			
		||||
formatter="clang-format -i"
 | 
			
		||||
version=$($formatter --version | grep -o '[0-9\.]*')
 | 
			
		||||
 | 
			
		||||
if [[ "18.0.0" > "$version" ]]; then
 | 
			
		||||
if [[ "19.0.0" > "$version" ]]; then
 | 
			
		||||
    cat <<EOF
 | 
			
		||||
 | 
			
		||||
                                    ERROR
 | 
			
		||||
-----------------------------------------------------------------------------
 | 
			
		||||
            A minimum of version 18 of `which clang-format` is required.
 | 
			
		||||
            A minimum of version 19 of `which clang-format` is required.
 | 
			
		||||
            Your version is $version.
 | 
			
		||||
            Please fix paths and run again.
 | 
			
		||||
-----------------------------------------------------------------------------
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								.github/workflows/clang-tidy.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/clang-tidy.yml
									
									
									
									
										vendored
									
									
								
							@@ -60,7 +60,7 @@ jobs:
 | 
			
		||||
        shell: bash
 | 
			
		||||
        id: run_clang_tidy
 | 
			
		||||
        run: |
 | 
			
		||||
          run-clang-tidy-18 -p build -j ${{ steps.number_of_threads.outputs.threads_number }} -fix -quiet 1>output.txt
 | 
			
		||||
          run-clang-tidy-19 -p build -j ${{ steps.number_of_threads.outputs.threads_number }} -fix -quiet 1>output.txt
 | 
			
		||||
 | 
			
		||||
      - name: Check format
 | 
			
		||||
        if: ${{ steps.run_clang_tidy.outcome != 'success' }}
 | 
			
		||||
 
 | 
			
		||||
@@ -21,7 +21,7 @@ git config --local core.hooksPath .githooks
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Git hooks dependencies
 | 
			
		||||
The pre-commit hook requires `clang-format >= 18.0.0` and `cmake-format` to be installed on your machine.
 | 
			
		||||
The pre-commit hook requires `clang-format >= 19.0.0` and `cmake-format` to be installed on your machine.
 | 
			
		||||
`clang-format` can be installed using `brew` on macOS and default package manager on Linux.
 | 
			
		||||
`cmake-format` can be installed using `pip`.
 | 
			
		||||
The hook will also attempt to automatically use `doxygen` to verify that everything public in the codebase is covered by doc comments. If `doxygen` is not installed, the hook will raise a warning suggesting to install `doxygen` for future commits.
 | 
			
		||||
@@ -105,7 +105,7 @@ The button for that is near the bottom of the PR's page on GitHub.
 | 
			
		||||
This is a non-exhaustive list of recommended style guidelines. These are not always strictly enforced and serve as a way to keep the codebase coherent.
 | 
			
		||||
 | 
			
		||||
## Formatting
 | 
			
		||||
Code must conform to `clang-format` version 18, unless the result would be unreasonably difficult to read or maintain.
 | 
			
		||||
Code must conform to `clang-format` version 19, unless the result would be unreasonably difficult to read or maintain.
 | 
			
		||||
In most cases the pre-commit hook will take care of formatting and will fix any issues automatically.
 | 
			
		||||
To manually format your code, use `clang-format -i <your changed files>` for C++ files and `cmake-format -i <your changed files>` for CMake files.
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -8,7 +8,7 @@ if (lint)
 | 
			
		||||
    endif ()
 | 
			
		||||
    message(STATUS "Using clang-tidy from CLIO_CLANG_TIDY_BIN")
 | 
			
		||||
  else ()
 | 
			
		||||
    find_program(_CLANG_TIDY_BIN NAMES "clang-tidy-18" "clang-tidy" REQUIRED)
 | 
			
		||||
    find_program(_CLANG_TIDY_BIN NAMES "clang-tidy-19" "clang-tidy" REQUIRED)
 | 
			
		||||
  endif ()
 | 
			
		||||
 | 
			
		||||
  if (NOT _CLANG_TIDY_BIN)
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@ USER root
 | 
			
		||||
WORKDIR /root
 | 
			
		||||
 | 
			
		||||
ENV CCACHE_VERSION=4.10.2 \
 | 
			
		||||
    LLVM_TOOLS_VERSION=18 \
 | 
			
		||||
    LLVM_TOOLS_VERSION=19 \
 | 
			
		||||
    GH_VERSION=2.40.0 \
 | 
			
		||||
    DOXYGEN_VERSION=1.12.0
 | 
			
		||||
 
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@ You can find an example docker-compose file, with Prometheus and Grafana configs
 | 
			
		||||
 | 
			
		||||
## Using `clang-tidy` for static analysis
 | 
			
		||||
 | 
			
		||||
The minimum [clang-tidy](https://clang.llvm.org/extra/clang-tidy/) version required is 17.0.
 | 
			
		||||
The minimum [clang-tidy](https://clang.llvm.org/extra/clang-tidy/) version required is 19.0.
 | 
			
		||||
 | 
			
		||||
Clang-tidy can be run by Cmake when building the project. To achieve this, you just need to provide the option `-o lint=True` for the `conan install` command:
 | 
			
		||||
 | 
			
		||||
@@ -26,5 +26,5 @@ By default Cmake will try to find `clang-tidy` automatically in your system.
 | 
			
		||||
To force Cmake to use your desired binary, set the `CLIO_CLANG_TIDY_BIN` environment variable to the path of the `clang-tidy` binary. For example:
 | 
			
		||||
 | 
			
		||||
```sh
 | 
			
		||||
export CLIO_CLANG_TIDY_BIN=/opt/homebrew/opt/llvm@17/bin/clang-tidy
 | 
			
		||||
export CLIO_CLANG_TIDY_BIN=/opt/homebrew/opt/llvm@19/bin/clang-tidy
 | 
			
		||||
```
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user