From c48bc9fa166a6b099cfd0c805ceafc2acb6b7265 Mon Sep 17 00:00:00 2001 From: matyalatte Date: Thu, 17 Oct 2024 06:38:34 +0900 Subject: [PATCH 1/2] conform to cpplint 2.0 --- .github/workflows/benchmark.yml | 2 +- .github/workflows/ci.yml | 2 +- docs/CHANGELOG.md | 4 ++++ docs/CONTRIBUTING.md | 4 ++-- docs/README.md | 2 +- setup.py | 2 +- src/version.h.in | 2 +- 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 955750a..3121484 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -38,7 +38,7 @@ jobs: - name: Copy gooletest, Download cpplint.py run: | cp -r subprojects/googletest-${{ env.GTEST_VER }} ../ - curl -O https://raw.githubusercontent.com/cpplint/cpplint/ab7335bcc734f6d21226631060888bfb77bbc9d7/cpplint.py + curl -O https://raw.githubusercontent.com/cpplint/cpplint/refs/tags/2.0.0/cpplint.py - name: Show CPU info run: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4465db5..f728aca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: python-version: '3.10' - run: pip3 install cpplint codespell - run: | - cpplint --recursive --quiet --filter=-build/c++11,-build/c++17,-readability/nolint,-runtime/printf_format . + cpplint --recursive --quiet --filter=-readability/nolint . codespell test: diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 467c37a..54e9452 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,10 @@ ## 0.3.0 (Unreleased) +- cpplint-cpp now conforms to [cpplint 2.0](https://github.com/cpplint/cpplint/tree/2.0.0). + - Disabled readability/fn_size by default. (https://github.com/matyalatte/cpplint-cpp/pull/14) + - Cast checks now uses standard fixed-width typenames. (https://github.com/matyalatte/cpplint-cpp/pull/15) + - Fixed false positives on concept declaration. (https://github.com/matyalatte/cpplint-cpp/pull/16) - Fixed a bug where `latch` and `numbers` were not considered as c++ headers, courtesy of @GermanAizek. (https://github.com/matyalatte/cpplint-cpp/pull/6) - `--exclude` now supports glob patterns. (https://github.com/matyalatte/cpplint-cpp/pull/9) - Fixed a compile error on Ubuntu20.04 with an old version of GCC. (https://github.com/matyalatte/cpplint-cpp/pull/12) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 96c1b37..9656873 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -7,7 +7,7 @@ cpplint-cpp is an open-source project that warmly welcomes contributions. We app The following types of changes are not acceptable. Before you start contributing, ensure that your work does not involve the following: - Adding support for new coding rules that cpplint.py does not support. -- Breaking compatibility with [cpplint.py 1.7](https://github.com/cpplint/cpplint/tree/ab7335bcc734f6d21226631060888bfb77bbc9d7). +- Breaking compatibility with [cpplint.py 2.0](https://github.com/cpplint/cpplint/tree/2.0.0). - Making extensive algorithm changes that would make it difficult for cpplint.py users to read the source code. - Implementing platform-specific optimizations (e.g., using SIMD extensions). @@ -38,7 +38,7 @@ cpplint-cpp should maintain compatibility with cpplint.py. For the same file, th No merge request may be merged until it passes the following code checks: -- Linting by cpplint.py 1.7 (or cpplint-cpp) +- Linting by cpplint.py 2.0 (or cpplint-cpp) - Typo check by [codespell](https://github.com/codespell-project/codespell) - Unit tests with `meson test -C build` diff --git a/docs/README.md b/docs/README.md index c44fee2..fd0b31a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,7 +2,7 @@ [![License](https://img.shields.io/badge/License-BSD_3--Clause-green.svg)](https://opensource.org/licenses/BSD-3-Clause) -C++ reimplementation of [cpplint 1.7](https://github.com/cpplint/cpplint/tree/ab7335bcc734f6d21226631060888bfb77bbc9d7) +C++ reimplementation of [cpplint 2.0](https://github.com/cpplint/cpplint/tree/2.0.0) ## What is cpplint? diff --git a/setup.py b/setup.py index c160910..3ffb2c0 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ setup( name='cpplint-cpp', version=version, - description='C++ reimplementation of cpplint 1.7', + description='C++ reimplementation of cpplint 2.0', long_description=open('docs/README.md').read(), long_description_content_type='text/markdown', author='matyalatte', diff --git a/src/version.h.in b/src/version.h.in index 08bd989..ce03f0b 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -6,7 +6,7 @@ #define CPPLINT_VERSION "@VERSION@" // Version of cpplint.py -#define ORIGINAL_VERSION "1.7" +#define ORIGINAL_VERSION "2.0" // Platform tag for pip #define PLATFORM_TAG "@PLATFORM_TAG@" From b5b8afb42ab31101cad223400a8b161f2a3881de Mon Sep 17 00:00:00 2001 From: matyalatte Date: Sat, 19 Oct 2024 07:21:32 +0900 Subject: [PATCH 2/2] update benchmark result --- docs/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/README.md b/docs/README.md index fd0b31a..0a0ca8f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -29,8 +29,8 @@ You can see `cpplint-cpp` has significantly better performance, being over 30 ti | | googletest-1.14.0 (s) | cpplint-cpp (s) | | ----------- | --------------------- | --------------- | -| cpplint-cpp | 0.443100 | 0.090062 | -| cpplint.py | 25.826862 | 3.865572 | +| cpplint-cpp | 0.439020 | 0.092547 | +| cpplint.py | 21.639285 | 3.782867 | ### Memory usage @@ -38,8 +38,8 @@ Despite using multithreading with 4 cores, `cpplint-cpp` has lower memory usage | | googletest-1.14.0 | cpplint-cpp | | ----------- | ----------------- | ----------- | -| cpplint-cpp | 15.55 MiB | 10.32 MiB | -| cpplint.py | 23.01 MiB | 22.43 MiB | +| cpplint-cpp | 15.46 MiB | 10.45 MiB | +| cpplint.py | 23.08 MiB | 22.57 MiB | ## Changes from cpplint.py