This is an archive of the discontinued LLVM Phabricator instance.

[clang][NFC] Remove trailing whitespaces and enforce it in lib, include and docs
ClosedPublic

Authored by philnik on Jun 1 2023, 7:40 PM.

Details

Summary

A lot of editors remove trailing whitespaces. This patch removes any trailing whitespaces and makes sure that no new ones are added.

Diff Detail

Event Timeline

philnik created this revision.Jun 1 2023, 7:40 PM
Herald added a reviewer: NoQ. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
NOTE: Clang-Format Team Automated Review Comment

Your review contains a change to ClangFormatStyleOptions.rst but not a change to clang/include/clang/Format/Format.h

ClangFormatStyleOptions.rst is auto generated from Format.h via clang/docs/tools/dump_format_style.py, please run this to regenerate the .rst

You can validate that the rst is valid by running.

./docs/tools/dump_format_style.py
mkdir -p html
/usr/bin/sphinx-build -n ./docs ./html
philnik requested review of this revision.Jun 1 2023, 7:40 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 1 2023, 7:40 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
erichkeane accepted this revision.Jun 2 2023, 6:28 AM

This looks fine to me. HOWEVER, please make sure to add this commit to https://github.com/llvm/llvm-project/blob/main/.git-blame-ignore-revs in a follow-up NFC commit.

paulkirth accepted this revision.Jun 20 2023, 8:59 AM

Also LGTM for the changes in MisExpect.rst, modulo feedback from @erichkeane.

philnik accepted this revision.Jun 25 2023, 7:05 PM
This revision is now accepted and ready to land.Jun 25 2023, 7:05 PM
This revision was landed with ongoing or failed builds.Jun 26 2023, 9:35 AM
This revision was automatically updated to reflect the committed changes.

This looks fine to me. HOWEVER, please make sure to add this commit to https://github.com/llvm/llvm-project/blob/main/.git-blame-ignore-revs in a follow-up NFC commit.

Please be sure to do this.

This looks fine to me. HOWEVER, please make sure to add this commit to https://github.com/llvm/llvm-project/blob/main/.git-blame-ignore-revs in a follow-up NFC commit.

Please be sure to do this.

This did get handled, thanks! Today I learned that changes to the top level in the monorepo don't make it to either of the llvm-commits or cfe-commits mailing lists.

ldionne added inline comments.
libcxx/utils/ci/buildkite-pipeline-clang.yml
20–31

Something in here broke the Clang CI. See for example https://buildkite.com/llvm-project/libcxx-ci/builds/27050#0188fe23-c359-4a1d-8d10-f0fb966f142e.

It's actually interesting, now the libc++ CI is lightning fast since we're not sharing our resources anymore. I'll follow-up on that, I never expected it to make such a huge difference.

eddyz87 added inline comments.
libcxx/utils/ci/buildkite-pipeline-clang.yml
20–31

I believe it's the following line:

commands:
  - "! grep -rnI '[[:blank:]]$' clang/lib clang/include clang/docs || false"

buildkite-agent interpolates variables in commands and reacts to $, so it should be:

commands:
  - "! grep -rnI '[[:blank:]]$$' clang/lib clang/include clang/docs || false"

Instead (note $$).

It is possible to test this locally using the following commands:

$ ./libcxx/utils/ci/generate-buildkite-pipeline > 1.ym
$ docker run -v `realpath 1.yml`:`realpath 1.yml` \
      --rm buildkite/agent:3 pipeline upload --dry-run \
      --agent-access-token xx `realpath 1.yml`
2023-06-30 14:36:35 INFO   Reading pipeline config from "/home/eddy/work/llvm-project/1.yml"
2023-06-30 14:36:35 FATAL  Pipeline parsing of "1.yml" failed (Expected identifier to start with a letter, got ')

The error is gone if '$$' change is applied. (But I have not tested if semantics of the command is preserved).
As far as I understand this link applies here.