From 92f7dd7160b02aa3ff8cdd74b95f9589951b44b0 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Sat, 25 Jul 2026 18:27:48 -0400 Subject: [PATCH 1/5] chore(infra): add towncrier and workflow to make sure each PR affecting *.py has a new changelog entry --- .github/workflows/check towncrier.yml | 16 ++++++++++++++++ changes/.gitkeep | 0 pyproject.toml | 4 ++++ 3 files changed, 20 insertions(+) create mode 100644 .github/workflows/check towncrier.yml create mode 100644 changes/.gitkeep diff --git a/.github/workflows/check towncrier.yml b/.github/workflows/check towncrier.yml new file mode 100644 index 00000000..5108fb1e --- /dev/null +++ b/.github/workflows/check towncrier.yml @@ -0,0 +1,16 @@ +name: Changelog entry +on: + pull_request: + paths: + - '*.py' +jobs: + change-exists: + runs-on: ubuntu-latest + steps: + - uses: dorny/paths-filter@v4 + id: filter + with: + filters: | + hasEntry: + - added: 'changes/*' + - run: exit $([[ ${{ steps.filter.outputs.hasEntry }} == 'true' ]]) diff --git a/changes/.gitkeep b/changes/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/pyproject.toml b/pyproject.toml index 7d3a943a..7bd1c95f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -210,3 +210,7 @@ tmp_path_retention_policy = "all" [tool.coverage] run.patch = [ "subprocess" ] + +[tool.towncrier] +directory = "changes" +type = [ { name = "Breaking" }, { name = "Feature" }, { name = "Bugfix" }, { name = "Refactor" } ] From c66f932280978319e23b50f92c2914c312bb39dd Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Sat, 25 Jul 2026 18:30:37 -0400 Subject: [PATCH 2/5] doc(CONTRIBUTING): update +towncrier +changes wanted and not -Google upstream info now that Google's discontinued public version renames use double backticks as this is RST --- CONTRIBUTING.rst | 110 +++++++++++++++++------------------------------ 1 file changed, 39 insertions(+), 71 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index f4bcc5a9..0faa021f 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -9,9 +9,12 @@ Any kinds of contributions are welcome: Bug reports, Documentation, Patches. How * Drastic reorganization * Making the code conform to Google's Python style guidelines * Features that could be regarded as a security vulnerability +* Very imperformant code covering very rare cases If you need some ideas, you may check out some of the tasks in our `issue tracker `_. +We encourage uncontroversial refactoring code that your PR touches, such as adding type hints and converting to match-case statements, as long as it is reasonably confined to the lines your PR touches. Any TODO items added should include your username and brief reasoning (e.g. ``@todo(aaronliu0130): should use walrus``). + Development =========== @@ -47,10 +50,24 @@ Pull requests When you're finished with a pull request, please: * add a relevant test case to cpplint_unittest.py -* add a summary of what your changes do to CHANGELOG.rst +* add a summary of what your changes do under changes/; see below * specify the problem solved in the pull request * make sure that your code passes the tests and lints * don't force-push to the branch just to squash everything into a single commit. These make the commit history messy, and we'll squash it when merging anyways. +* name the pull request as a `Conventional Commit `_ + +To avoid conflicts, changelog entries should be added as new files under changes/, which we'll use towncrier to concatenate when releasing. +Each file should be named in the format of "{issue number}.{change type}", (e.g. where {change type} is one of the following: + +* ``breaking``, for breaking changes, such as removal of +* ``feature``, for changes that add a feature, such as support for new syntax or new checks +* ``bugfix``, for changes that correct wrong behavior, such as false positives on specific syntax +* ``refactor``, for significant code changes, such as great performance optimizations (probably not just extracting code into functions) +* Changes that don't affect code do not need a changelog entry. + +Every entry should be one line like the entries in CHANGELOG.rst. Note that the changelog is `reStructuredText `_, meaning, among other things, that inline code needs two backticks instead of one. + +If you believe a change is not significant enough for a changelog entry, please mention this in the PR description. .. _testing: @@ -61,8 +78,8 @@ You can test your changes under your local python environment by running the tes .. code-block:: bash - # install test requirements - pip install .[test] + # install dev requirements + pip install .[dev] # run a single test pytest --no-cov cpplint_unittest.py -k testName # run a single CLI integration test @@ -73,18 +90,32 @@ You can test your changes under your local python environment by running the tes pylint cpplint.py pre-commit run --all-files -Alternatively, you can run `tox` to automatically run all tests and lints. Use `-e ` followed by the python runner and version (which you must have installed) to automatically generate the testing environment and run the above tests and lints in it. For example, `tox -e py39` does the steps in Python 3.9, `tox -e py313` does the steps in Python 3.13, and `tox -e pypy3` does the steps using the latest version of the pypy interpreter. +Alternatively, you can run ``tox`` to automatically run all tests and lints. Use ``-e `` followed by the python runner and version (which you must have installed) to automatically generate the testing environment and run the above tests and lints in it. For example, `tox -e py39` does the steps in Python 3.9, `tox -e py313` does the steps in Python 3.13, and `tox -e pypy3` does the steps using the latest version of the pypy interpreter. Releasing ========= -The release process first prepares the documentation, then publishes to testpypi to verify, then releases to real pypi. Testpypi acts like real pypi, so broken releases cannot be deleted. For a typical bugfixing release, no special issue on testpypi is expected (but it's still good practice). The commands are documented below, and assume you've went through the testing steps above. +The release process first prepares the documentation, then publishes to testpypi to verify, then releases to real pypi. The following instructions assume you have already run the testing steps above. -.. code-block:: bash +Have towncrier and twine installed. They are not included in ``.[dev]`` as release tools are not necessary for regular development and testing. + +To prepare the changelog, bump ``cpplint.__VERSION__`` so towncrier knows the version, run ``towncrier build``, prepend NEWS.rst to CHANGELOG.rst and delete the former, then match the output format: + +* Changes should be ordered by importance in one, big list. +* Non-maintainer contributors should be credited. +* Linking pull requests is optional. + +Testpypi acts like real pypi, so broken releases cannot be deleted. For a typical bugfixing release, no special issue on testpypi is expected (but it's still good practice). + +Commands that can do the above: + +.. code-block:: sh # prepare files for release $EDITOR cpplint.py # increment the version - $EDITOR CHANGELOG.rst # log changes + towncrier build --yes # creates NEWS.rst + cat CHANGELOG.rst >> NEWS.rst && git mv -f NEWS.rst CHANGELOG.rst # prepend towncrier output to changelog + $EDITOR CHANGELOG.rst # adjust git add cpplint.py CHANGELOG.rst git commit -m "Releasing x.y.z" # Build @@ -99,67 +130,4 @@ The release process first prepares the documentation, then publishes to testpypi git tag x.y.z git push --tags -After releasing, it is be good practice to comment on completed GitHub issues to notify authors. - -Catching up with Upstream -========================= - -For maintainers, it is a regular duty to look at what cpplint changes were merged upstream and include them in this fork (though these updates happen rarely). - -Checkout here and upstream google: - -.. code-block:: bash - - git clone git@github.com:cpplint/cpplint.git - cd cpplint - git remote add google https://github.com/google/styleguide - -To incorporate google's changes: - -.. code-block:: bash - - git fetch google gh-pages - - ## Merge workflow (clean, no new commits) - git checkout develop -b updates - git merge google/gh-pages # this will have a lot of conflicts - # ... solve conflicts - git merge -- continue - - ## Rebase workflow (dirty, creates new commits) - git checkout -b updates FETCH_HEAD - git rebase develop # this will have a lot of conflicts, most of which can be solved with the next command (run repeatedly) - # solve conflicts with files deleted in our fork (this is idempotent and safe to be called. when cpplint.py has conflicts, it will do nothing) - git status | grep 'new file:' | awk '{print $3}' | xargs -r git rm --cached ; git status | grep 'deleted by us' | awk '{print $4}' | xargs -r git rm - git status --untracked-files=no | grep 'nothing to commit' && git rebase --skip - - git push -u origin updates - # check github action - git push origin --delete updates - - git rebase updates develop - git branch -D updates - git push - -Setup fetching of pull requests in .git/config: - -.. code-block:: bash - - [remote "origin"] - url = git@github.com:cpplint/cpplint.git - fetch = +refs/heads/*:refs/remotes/origin/* - # following line should be new, fetches PRs from cpplint - fetch = +refs/pull/*/head:refs/remotes/origin/pr/* - [remote "google"] - url = https://github.com/google/styleguide - fetch = +refs/heads/*:refs/remotes/google/* - # following line should be new, fetches PRs from google/styleguides - fetch = +refs/pull/*/head:refs/remotes/google/pr/* - - -To compare this for with upstream (after git fetch): - -.. code-block:: bash - - git diff google/gh-pages:cpplint/cpplint.py develop:cpplint.py - git diff google/gh-pages:cpplint/cpplint_unittest.py develop:cpplint_unittest.py +After releasing, it is good practice to comment on completed GitHub issues to notify authors. From 7091ec8b91f3b6cbef358a694fc21e9c6f496939 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Sat, 25 Jul 2026 18:31:28 -0400 Subject: [PATCH 3/5] fix(CHANGELOG): double backticks for inline code --- CHANGELOG.rst | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4127d4e9..bc2b79bc 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -20,7 +20,7 @@ TBA Yet another overdue... hotfix. Sorry this took so long. * The false positive for indented function parameters in namespaces was eradicated. (https://github.com/cpplint/cpplint/pull/304) -* Files that end in ".c", ".C", or ".cu" will now also automatically suppress C++-only categories. Previously, `// NO_LINT_C` was required. (https://github.com/cpplint/cpplint/pull/318) +* Files that end in ".c", ".C", or ".cu" will now also automatically suppress C++-only categories. Previously, ``// NO_LINT_C`` was required. (https://github.com/cpplint/cpplint/pull/318) * build/include-what-you-use now recognizes c-style headers such as for symbols from . (https://github.com/cpplint/cpplint/pull/319) * Ruff, mypy, and codespell were ran on the project to improve performance and reader comprehension thanks to @cclauss. * Tests were refactored away from unittest to improve display with pytest by @cclauss. (https://github.com/cpplint/cpplint/pull/332) @@ -35,8 +35,8 @@ A large long-overdue modernization of the codebase! * Python versions less than 3.8 are no longer supported. Python 3.12 support was added along with fixed CI for 3.7 and 3.8, courtesy of @jayvdb * As a result of all this, setup.py's lint subcommand was removed. Please run the commands directly instead. * You can now specify blocks of code that exclude linting with NOLINTBEGIN and NOLINTEND, courtesy of @n3world (https://github.com/cpplint/cpplint/pull/213) -* The config filename can now be specified through `--config` thanks to @gedankenexperimenter (https://github.com/cpplint/cpplint/pull/198). Specifying a config file not under the current directory will be available in a future release. -* The `--filter` option can now be only applied to a specific file or even a specific line through utilizing colons, e.g. `-filter=-whitespace:foo.h,+whitespace/braces:foo.h:418`. Courtesy of @PhilLab (https://github.com/cpplint/cpplint/pull/171) +* The config filename can now be specified through ``--config`` thanks to @gedankenexperimenter (https://github.com/cpplint/cpplint/pull/198). Specifying a config file not under the current directory will be available in a future release. +* The ``--filter`` option can now be only applied to a specific file or even a specific line through utilizing colons, e.g. ``-filter=-whitespace:foo.h,+whitespace/braces:foo.h:418``. Courtesy of @PhilLab (https://github.com/cpplint/cpplint/pull/171) * NOLINT and NOLINTNEXTLINE comments now support a comma-separated list of categories, courtesy of @n3world (https://github.com/cpplint/cpplint/pull/220) * NOLINT and NOLINTNEXTLINE will now ignore categories known to be from clang-tidy thanks to @xatier (https://github.com/cpplint/cpplint/pull/231) * Fixed behavior with nested source repositories by @groegeorg (https://github.com/cpplint/cpplint/pull/78) @@ -45,8 +45,8 @@ A large long-overdue modernization of the codebase! * build/include-what-you-use will no longer err on similarly-named classes from other namespaces thanks to @geoffviola (https://github.com/cpplint/cpplint/pull/273) * Indented functions inside namespaces will now be correctly erred on, courtesy of @Yujinmon (https://github.com/cpplint/cpplint/pull/235) * The check for C-style casts now looks for the standard fixed-width integer typenames instead of non-standard ones (e.g. int32_t instead of int32) thanks to @nate-thirdwave (https://github.com/cpplint/cpplint/pull/282) -* `[[(un)likely]]` no longer clouds readability/braces's super spy−scanning of braces, courtesy of @aaronliu0130 (https://github.com/cpplint/cpplint/pull/265) -* `readability/braces` will realize that C++20 concepts require a semicolon, courtesy of @armandas (https://github.com/cpplint/cpplint/pull/288) +* ``[[(un)likely]]`` no longer clouds readability/braces's super spy−scanning of braces, courtesy of @aaronliu0130 (https://github.com/cpplint/cpplint/pull/265) +* ``readability/braces`` will realize that C++20 concepts require a semicolon, courtesy of @armandas (https://github.com/cpplint/cpplint/pull/288) * C++20 headers will no longer be flagged as C headers thanks to @miker2 (https://github.com/cpplint/cpplint/pull/216) * Same goes for C++23 and C23 headers, thanks to @aaronliu0130 (https://github.com/cpplint/cpplint/pull/239) * "complex.h" will be treated as the C99 header instead of the legacy C++ header by @tkruse (https://github.com/cpplint/cpplint/pull/219) @@ -56,10 +56,10 @@ A large long-overdue modernization of the codebase! * We will no longer bother you if you mark a no-arg constructor as explicit thanks to @markww (https://github.com/cpplint/cpplint/pull/227) * In the same PR, @aaronliu0130 also decreased the verbosity of nagging to mark single-arg constructors as explicit to 4, as the styleguide includes a major exception to this rule that would be very hard to detect. * Processing C++ files through stdin/piping is now fixed thanks to @aaronliu0130 (https://github.com/cpplint/cpplint/pull/289) -* You can now specify the name of the CPPLINT.cfg file through `--config` as long as it is in the same directory, thanks to @gedankenexperimenter (https://github.com/cpplint/cpplint/pull/198) +* You can now specify the name of the CPPLINT.cfg file through ``--config`` as long as it is in the same directory, thanks to @gedankenexperimenter (https://github.com/cpplint/cpplint/pull/198) * The new __VA_OPT__(,) will now be recognized by the Whitespace linter as a function thanks to @elrinor (https://github.com/cpplint/cpplint/pull/237) * The check for including a source file's header file will now scan all files with the same base name. Thanks to @crogre for figuring out what code needed to be changed and @aaronliu0130 for fixing it (https://github.com/cpplint/cpplint/pull/104) -* `build/class` and `build/namespaces` no longer check for whether a namespace or class has a closing brace from @geoffviola (https://github.com/cpplint/cpplint/pull/272). This should be done in a more efficient manner by a compiler or language server instead. As part of this, the `build/class` category was removed. +* ``build/class`` and ``build/namespaces`` no longer check for whether a namespace or class has a closing brace from @geoffviola (https://github.com/cpplint/cpplint/pull/272). This should be done in a more efficient manner by a compiler or language server instead. As part of this, the ``build/class`` category was removed. * Fixed false positive when an if/else statement has braces everywhere but one of the closing braces before the final block is on a separate line by @aaronliu0130 (https://github.com/cpplint/cpplint/pull/265) * For header files, the check for a header guard's name will now be cached and only run once, as opposed to previously being run on every line. This results in a ~5.6% reduction in run time thanks to @matyalatte, who figured it out, and @aaronliu0130 for implementing it (https://github.com/cpplint/cpplint/pull/291) * Usages of the deprecated sre_compile were refactored by @jspricke (https://github.com/cpplint/cpplint/pull/214) @@ -113,7 +113,7 @@ A large long-overdue modernization of the codebase! 1.5.1 (2020-06-05) ================== -* Revert #43 behavior change for include order from 1.5.0, and hide it behind command-line-flag `--includeorder=standardcfirst`. +* Revert #43 behavior change for include order from 1.5.0, and hide it behind command-line-flag ``--includeorder=standardcfirst``. It turns out there is no easy objective way to tell c system headers from certain c++ library headers, and Google cpplint intentionally classifies some C++ header includes as C system header for simplicity. * Libraries considered as C system headers using --includeorder=standardcfirst now also includes linux-specific headers (glibc-devel, glibc-kernheaders, linux-libc-dev). @@ -133,8 +133,8 @@ A large long-overdue modernization of the codebase! 1.4.5 (2020-01-13) ================== -* Avoid false positive for [build/include_what_you_use] in case of `foo.set` and `foo->set` usage. -* Avoid false positive for [build/include_what_you_use] in case of `map` is user defined function +* Avoid false positive for [build/include_what_you_use] in case of ``foo.set`` and ``foo->set`` usage. +* Avoid false positive for [build/include_what_you_use] in case of ``map`` is user defined function * Escape backslashes in pydoc strings to get rid of DeprecationWarning. * Fix false positive "should include its header" for 3rd party headers * Add support for c++17 tuple destructuring @@ -149,12 +149,12 @@ Another cleanup release * NOBUG: fix unit/cli tests for source release * NOBUG: reduce diff to upstream by intentionally using deprecated functions where upstream uses them -* add `--version` command (https://github.com/cpplint/cpplint/issues/27) +* add ``--version`` command (https://github.com/cpplint/cpplint/issues/27) 1.4.3 (2019-02-18) ================== -* Revert "Fix the `build/endif_comment` check", same as reverted in upstream +* Revert "Fix the ``build/endif_comment`` check", same as reverted in upstream 1.4.2 (2019-02-17) ================== @@ -170,12 +170,12 @@ Another cleanup release ================== * Incorporate cpplint updates from google (e5d807c6a0d, 2018-05-03) - * Fix the `build/endif_comment` check (https://github.com/google/styleguide/pull/169) + * Fix the ``build/endif_comment`` check (https://github.com/google/styleguide/pull/169) * Teach the explicit constructor check about constexpr (#56) * Changed vs7 output format (#57) * Remove presubmit check for DISALLOW_* macros (#54) - * add `--quiet` flag as in upstream (https://github.com/google/styleguide/pull/293) - * support `--root` argument to run in different folder (https://github.com/google/styleguide/pull/291) + * add ``--quiet`` flag as in upstream (https://github.com/google/styleguide/pull/293) + * support ``--root`` argument to run in different folder (https://github.com/google/styleguide/pull/291) * Fix 16bit Unicode issue (https://github.com/google/styleguide/issues/337) 1.3.0 (2016-07-12) @@ -198,8 +198,8 @@ Another cleanup release 1.2.0 (2016-03-19) ================== -* Adds `.cu` and `.cuh` as supported file extensions by default. -* Moves the warning "Include the directory when naming .h files" from the `build/include` category to the `build/include_subdir` category. +* Adds ``.cu`` and ``.cuh`` as supported file extensions by default. +* Moves the warning "Include the directory when naming .h files" from the ``build/include`` category to the ``build/include_subdir`` category. 1.1.0 (2016-02-24) ================== From e1cf1d8206b31c062aea1d799413df210c514d6b Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Sat, 25 Jul 2026 21:20:10 -0400 Subject: [PATCH 4/5] feat(CI): make job skippable for non-py changes apparently I had been working on something like this in April 2025! implement skip-changelog label one job status to check include summary messages of why failed As a result of incorporating the changelog check, this should no longer run on commits to `develop`, which shouldn't be a problem as we don't directly push there anymore anyways. --- .github/workflows/check towncrier.yml | 16 -------- .github/workflows/ci.yml | 55 ++++++++++++++++++++++++--- 2 files changed, 49 insertions(+), 22 deletions(-) delete mode 100644 .github/workflows/check towncrier.yml diff --git a/.github/workflows/check towncrier.yml b/.github/workflows/check towncrier.yml deleted file mode 100644 index 5108fb1e..00000000 --- a/.github/workflows/check towncrier.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Changelog entry -on: - pull_request: - paths: - - '*.py' -jobs: - change-exists: - runs-on: ubuntu-latest - steps: - - uses: dorny/paths-filter@v4 - id: filter - with: - filters: | - hasEntry: - - added: 'changes/*' - - run: exit $([[ ${{ steps.filter.outputs.hasEntry }} == 'true' ]]) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b906ebc1..8c8b4788 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,14 +1,32 @@ -name: Test +name: Validation on: pull_request: - push: - branches: [master, develop] - workflow_dispatch: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: + check-paths: + runs-on: ubuntu-latest + steps: + - uses: dorny/paths-filter@v4 + id: filter + with: + filters: | + nondoc: + - '!**/*.rst' + hasLog: + - added: 'changes/*' + py: + - '*.py' + outputs: + shouldTest: ${{ steps.filter.outputs.nondoc == 'true' }} + needsLog: ${{ steps.filter.outputs.py == 'true' }} + changelogged: ${{ steps.filter.outputs.hasLog == 'true' }} + build-test: + name: Continuous Integration + needs: check-paths + if: needs.check-paths.outputs.shouldTest runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -20,8 +38,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v7 - with: - fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v6 with: @@ -34,3 +50,30 @@ jobs: pip install --editable ".[dev]" - name: Test with tox run: tox -e py + + changelog: + name: Changelog requirement + needs: check-paths + if: | + needs.check-paths.outputs.needsLog && + !contains(github.event.pull_request.labels.*.name, 'skip-changelog') && + !contains(github.event.pull_request.labels.*.name, 'dependencies') && + github.event.pull_request.user.name != 'pre-commit-ci' + # impossible to make pre-commit-ci add label "at least not for free tier" + runs-on: ubuntu-latest + steps: + - run: | + exit $([[ ${{ needs.check-paths.outputs.changelogged }} == 'true' ]]) + + pass: + name: Summary + needs: [ build-test, changelog ] + if: always() + runs-on: ubuntu-latest + steps: + - name: Fail if changelog ran and failed + if: ${{ needs.changelog.result == 'failure' }} + run: echo "Please follow instructions under https://github.com/cpplint/cpplint/blob/crytown/CONTRIBUTING.rst#pull-requests to add a changelog entry\nor request the 'skip-changelog' label if you believe the changes should not be in the changelog."; exit 1 + - name: Fail if build-test ran and failed + if: ${{ needs.build-test.result == 'failure' }} + run: echo "Failed required test(s).\nSee https://github.com/cpplint/cpplint/blob/develop/CONTRIBUTING.rst#testing for help on testing."; exit 1 From 91557ed1aa846c72ec7d32e48d77978755fb4a20 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Tue, 11 Aug 2026 10:54:45 -0400 Subject: [PATCH 5/5] fix(CI): re-run on label, report status to .md step summary --- .github/workflows/ci.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c8b4788..9f0c3139 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,12 @@ name: Validation on: pull_request: + types: [opened, reopened, synchronize, labeled] concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: - check-paths: + choose-jobs: runs-on: ubuntu-latest steps: - uses: dorny/paths-filter@v4 @@ -25,8 +26,8 @@ jobs: build-test: name: Continuous Integration - needs: check-paths - if: needs.check-paths.outputs.shouldTest + needs: choose-jobs + if: needs.choose-jobs.outputs.shouldTest runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -53,9 +54,9 @@ jobs: changelog: name: Changelog requirement - needs: check-paths + needs: choose-jobs if: | - needs.check-paths.outputs.needsLog && + needs.choose-jobs.outputs.needsLog && !contains(github.event.pull_request.labels.*.name, 'skip-changelog') && !contains(github.event.pull_request.labels.*.name, 'dependencies') && github.event.pull_request.user.name != 'pre-commit-ci' @@ -63,7 +64,7 @@ jobs: runs-on: ubuntu-latest steps: - run: | - exit $([[ ${{ needs.check-paths.outputs.changelogged }} == 'true' ]]) + exit $([[ ${{ needs.choose-jobs.outputs.changelogged }} == 'true' ]]) pass: name: Summary @@ -73,7 +74,7 @@ jobs: steps: - name: Fail if changelog ran and failed if: ${{ needs.changelog.result == 'failure' }} - run: echo "Please follow instructions under https://github.com/cpplint/cpplint/blob/crytown/CONTRIBUTING.rst#pull-requests to add a changelog entry\nor request the 'skip-changelog' label if you believe the changes should not be in the changelog."; exit 1 + run: echo "Please follow instructions under https://github.com/cpplint/cpplint/blob/crytown/CONTRIBUTING.rst#pull-requests to add a changelog entry\nor request the `skip-changelog` label if you believe the changes should not be in the changelog." >> $GITHUB_STEP_SUMMARY; exit 1 - name: Fail if build-test ran and failed if: ${{ needs.build-test.result == 'failure' }} - run: echo "Failed required test(s).\nSee https://github.com/cpplint/cpplint/blob/develop/CONTRIBUTING.rst#testing for help on testing."; exit 1 + run: echo "Failed required test(s).\nSee https://github.com/cpplint/cpplint/blob/develop/CONTRIBUTING.rst#testing for help on testing." >> $GITHUB_STEP_SUMMARY; exit 1