Skip to content

style: pragma once in header file#15274

Merged
alyssawilk merged 1 commit intoenvoyproxy:mainfrom
lambdai:pragmaonce
Mar 3, 2021
Merged

style: pragma once in header file#15274
alyssawilk merged 1 commit intoenvoyproxy:mainfrom
lambdai:pragmaonce

Conversation

@lambdai
Copy link
Copy Markdown
Contributor

@lambdai lambdai commented Mar 3, 2021

Commit Message:
Add pragma once almost every header.
Signed-off-by: Yuchen Dai silentdai@gmail.com

Additional Description:

for f in `find include/ source/ test/ -name "*.h"`; do grep "pragma once" $f >/dev/null|| echo $f; done | grep -v test_data |grep -v test/config/integration/certs |grep -v chromium |  xargs sed -i '1s/^/#pragma once\n\n/'

Exceptions

ource/common/chromium_url/url_parse.h
source/common/chromium_url/url_parse_internal.h
source/common/chromium_url/url_canon_stdstring.h
source/common/chromium_url/url_canon_internal.h
source/common/chromium_url/url_canon.h
test/config/integration/certs/clientcert_hash.h
test/config/integration/certs/client_ecdsacert_hash.h
test/config/integration/certs/upstreamlocalhostcert_hash.h
test/config/integration/certs/upstreamcert_hash.h
test/config/integration/certs/server_ecdsacert_hash.h
test/config/integration/certs/servercert_hash.h
test/extensions/transport_sockets/tls/test_data/extensions_cert_info.h
test/extensions/transport_sockets/tls/test_data/ca_cert_info.h
test/extensions/transport_sockets/tls/test_data/no_subject_cert_info.h
test/extensions/transport_sockets/tls/test_data/san_uri_cert_info.h
test/extensions/transport_sockets/tls/test_data/san_dns2_cert_info.h
test/extensions/transport_sockets/tls/test_data/selfsigned_rsa_1024_cert_info.h
test/extensions/transport_sockets/tls/test_data/selfsigned_ecdsa_p256_cert_info.h
test/extensions/transport_sockets/tls/test_data/no_san_cert_info.h
test/extensions/transport_sockets/tls/test_data/san_only_dns_cert_info.h
test/extensions/transport_sockets/tls/test_data/san_multiple_dns_cert_info.h
test/extensions/transport_sockets/tls/test_data/selfsigned_rsa_3072_cert_info.h
test/extensions/transport_sockets/tls/test_data/selfsigned_rsa_4096_cert_info.h
test/extensions/transport_sockets/tls/test_data/unittest_cert_info.h
test/extensions/transport_sockets/tls/test_data/selfsigned2_ecdsa_p256_cert_info.h
test/extensions/transport_sockets/tls/test_data/password_protected_cert_info.h
test/extensions/transport_sockets/tls/test_data/san_ip_cert_info.h
test/extensions/transport_sockets/tls/test_data/intermediate_ca_cert_info.h
test/extensions/transport_sockets/tls/test_data/san_dns3_cert_info.h
test/extensions/transport_sockets/tls/test_data/selfsigned_ecdsa_p384_cert_info.h
test/extensions/transport_sockets/tls/test_data/selfsigned_cert_info.h
test/extensions/transport_sockets/tls/test_data/fake_ca_cert_info.h
test/extensions/transport_sockets/tls/test_data/selfsigned2_cert_info.h
test/extensions/transport_sockets/tls/test_data/long_validity_cert_info.h
test/extensions/transport_sockets/tls/test_data/san_dns_cert_info.h
test/extensions/transport_sockets/tls/test_data/san_dns4_cert_info.h
test/extensions/transport_sockets/tls/test_data/expired_cert_info.h
test/extensions/transport_sockets/tls/test_data/expired_san_uri_cert_info.h

Risk Level: LOW
Testing: self-contained
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
Part of #15264
[Optional Deprecated:]
[Optional API Considerations:]

Signed-off-by: Yuchen Dai <silentdai@gmail.com>
@lambdai lambdai marked this pull request as ready for review March 3, 2021 07:59
Copy link
Copy Markdown
Contributor

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! Optionally, would you be willing to also extend the format scripts to catch this, to future-proof?

@alyssawilk
Copy link
Copy Markdown
Contributor

also, why the exceptions?

@alyssawilk alyssawilk merged commit e9f025a into envoyproxy:main Mar 3, 2021
@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Mar 3, 2021

LGTM, thanks! Optionally, would you be willing to also extend the format scripts to catch this, to future-proof?

Yes, it's on my plate. Not started yet though. Any help is welcomed. I will label the issue

@lambdai
Copy link
Copy Markdown
Contributor Author

lambdai commented Mar 3, 2021

also, why the exceptions?

test data seems auto generated and not linked in C++ code.
chromium_url: I need to understand if this requirement is adding the overhead to chomium_url owner when updating the new version.

I have no immediate answer in the night :(

@lambdai lambdai deleted the pragmaonce branch March 3, 2021 18:46
@alyssawilk
Copy link
Copy Markdown
Contributor

Gotcha, thanks for the explanation :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants