Skip to content

Commit 1c70205

Browse files
committed
chore: create repository structure
0 parents  commit 1c70205

File tree

110 files changed

+7612
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

110 files changed

+7612
-0
lines changed

Diff for: .bazelignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
ci/
2+
cmake-out/
3+
cmake-build-*/

Diff for: .bazelrc

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# To workaround a bug in Bazel [1], gRPC requires this flag on macOS builds,
16+
# and there is (AFAIK) no way to "inherit" their definitions.
17+
# [1]: https://github.com/bazelbuild/bazel/issues/4341
18+
build --copt=-DGRPC_BAZEL_BUILD
19+
20+
# Clang Sanitizers, use with (for example):
21+
#
22+
# --client_env=CXX=clang++ --client_env=CC=clang --config asan
23+
#
24+
25+
# --config asan: Address Sanitizer
26+
build:asan --strip=never
27+
build:asan --copt=-Og
28+
build:asan --copt=-g
29+
build:asan --copt=-fsanitize=address
30+
build:asan --copt=-fno-omit-frame-pointer
31+
build:asan --linkopt=-fsanitize=address
32+
build:asan --action_env=ASAN_OPTIONS=detect_leaks=1:color=always
33+
build:asan --action_env=LSAN_OPTIONS=report_objects=1
34+
35+
# --config tsan: Thread Sanitizer
36+
build:tsan --strip=never
37+
build:tsan --copt=-Og
38+
build:tsan --copt=-g
39+
build:tsan --copt=-fsanitize=thread
40+
build:tsan --copt=-fno-omit-frame-pointer
41+
build:tsan --linkopt=-fsanitize=thread
42+
build:tsan --action_env=TSAN_OPTIONS=halt_on_error=1:second_deadlock_stack=1
43+
44+
# --config ubsan: Undefined Behavior Sanitizer
45+
build:ubsan --strip=never
46+
build:ubsan --copt=-Og
47+
build:ubsan --copt=-g
48+
build:ubsan --copt=-fsanitize=undefined
49+
build:ubsan --copt=-fno-omit-frame-pointer
50+
build:ubsan --linkopt=-fsanitize=undefined
51+
build:ubsan --linkopt=-lubsan
52+
build:ubsan --action_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1
53+
54+
# --config msan: Memory Sanitizer
55+
build:msan --strip=never
56+
build:msan --copt=-Og
57+
build:msan --copt=-g
58+
build:msan --copt=-fsanitize=memory
59+
build:msan --copt=-fno-omit-frame-pointer
60+
build:msan --copt=-fsanitize-memory-track-origins
61+
build:msan --copt=-fsanitize-memory-use-after-dtor
62+
build:msan --linkopt=-fsanitize=memory
63+
build:msan --action_env=MSAN_OPTIONS=poison_in_dtor=1
64+
build:msan --cxxopt=-stdlib=libc++
65+
build:msan --linkopt=-stdlib=libc++
66+
build:msan --linkopt=-lc++
67+
build:msan --linkopt=-lc++abi

Diff for: .clang-format

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Use the Google style in this project.
2+
BasedOnStyle: Google
3+
4+
# Some folks prefer to write "int& foo" while others prefer "int &foo". The
5+
# Google Style Guide only asks for consistency within a project, we chose
6+
# "int& foo" for this project:
7+
DerivePointerAlignment: false
8+
PointerAlignment: Left
9+
10+
IncludeBlocks: Merge
11+
IncludeCategories:
12+
- Regex: '^\"google/cloud/pubsub'
13+
Priority: 500
14+
- Regex: '^\"google/cloud/'
15+
Priority: 1500
16+
- Regex: '^\"'
17+
Priority: 1000
18+
- Regex: '^<grpc/'
19+
Priority: 2000
20+
- Regex: '^<google/*'
21+
Priority: 3000
22+
- Regex: '^<.*/.*'
23+
Priority: 4000
24+
- Regex: '^<[^/]*>'
25+
Priority: 5000
26+
27+
# Format raw string literals with a `pb` or `proto` tag as proto.
28+
RawStringFormats:
29+
- Language: TextProto
30+
Delimiters:
31+
- 'pb'
32+
- 'proto'
33+
BasedOnStyle: Google
34+
35+
CommentPragmas: '(@copydoc)'

Diff for: .clang-tidy

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
# Configure clang-tidy for this project.
3+
4+
# Disabled:
5+
# -google-readability-namespace-comments the *_CLIENT_NS is a macro, and
6+
# clang-tidy fails to match it against the initial value.
7+
Checks: >
8+
-*,
9+
bugprone-*,
10+
google-*,
11+
misc-*,
12+
modernize-*,
13+
performance-*,
14+
portability-*,
15+
readability-*,
16+
-google-readability-namespace-comments,
17+
-google-runtime-references,
18+
-misc-non-private-member-variables-in-classes,
19+
-readability-named-parameter,
20+
-readability-braces-around-statements,
21+
-readability-magic-numbers
22+
23+
# Turn all the warnings from the checks above into errors.
24+
WarningsAsErrors: "*"
25+
26+
CheckOptions:
27+
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
28+
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
29+
- { key: readability-identifier-naming.StructCase, value: CamelCase }
30+
- { key: readability-identifier-naming.TemplateParameterCase, value: CamelCase }
31+
- { key: readability-identifier-naming.FunctionCase, value: CamelCase }
32+
- { key: readability-identifier-naming.VariableCase, value: lower_case }
33+
- { key: readability-identifier-naming.ClassMemberCase, value: lower_case }
34+
- { key: readability-identifier-naming.ClassMemberSuffix, value: _ }
35+
- { key: readability-identifier-naming.PrivateMemberSuffix, value: _ }
36+
- { key: readability-identifier-naming.ProtectedMemberSuffix, value: _ }
37+
- { key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }
38+
- { key: readability-identifier-naming.EnumConstantCase, value: CamelCase }
39+
- { key: readability-identifier-naming.EnumConstantPrefix, value: k }
40+
- { key: readability-identifier-naming.ConstexprVariableCase, value: CamelCase }
41+
- { key: readability-identifier-naming.ConstexprVariablePrefix, value: k }
42+
- { key: readability-identifier-naming.GlobalConstantCase, value: CamelCase }
43+
- { key: readability-identifier-naming.GlobalConstantPrefix, value: k }
44+
- { key: readability-identifier-naming.MemberConstantCase, value: CamelCase }
45+
- { key: readability-identifier-naming.MemberConstantPrefix, value: k }
46+
- { key: readability-identifier-naming.StaticConstantCase, value: CamelCase }
47+
- { key: readability-identifier-naming.StaticConstantPrefix, value: k }

Diff for: .codecov.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Disable commit statuses
2+
coverage:
3+
status:
4+
project: no
5+
patch: no
6+
changes: no
7+
8+
ignore:
9+
# Ignore code generated by protobuf.
10+
- "*.pb.cc"
11+
- "*.pb.h"
12+
# Ignore the testing classes and functions, they are not important for the
13+
# experience for our users.
14+
- "/google/cloud/pubsub/testing/**"
15+
# Ignore the integration tests, they are not important for the experience for
16+
# our users.
17+
- "/google/cloud/pubsub/integration_tests/**"
18+
# Ignore the benchmarks, they are not important for the experience for our
19+
# users.
20+
- "/google/cloud/pubsub/benchmarks/**"
21+
# Also ignore the unit tests.
22+
- "**/*_test.cc$"

Diff for: .dockerignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# We do not need the git repository in docker images.
2+
.git/
3+
4+
# We do not need the typical build directories in docker images.
5+
.idea/
6+
.build/
7+
_build/
8+
build-output/
9+
cmake-build-*/
10+
cmake-out/
11+
12+
# Skip these directories, the files here are not needed to build any of
13+
# the Docker images. Furthermore, when creating new Dockerfiles the files
14+
# here change a lot, but do not change the image, so they trigger image rebuids
15+
# without any benefit.
16+
ci/kokoro/

Diff for: .gitignore

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Common build output directory names
2+
.build/
3+
_build/
4+
build-output/
5+
cmake-out/
6+
7+
# Common bazel output directories
8+
bazel-*
9+
!bazel-*.cfg
10+
11+
# File used by clang-based refactoring tools
12+
compile_commands.json
13+
14+
# Backup files for Emacs
15+
*~
16+
17+
# Ignore IDEA / IntelliJ files
18+
.idea/
19+
cmake-build-*/
20+
21+
# Ignore Visual Studio code directories.
22+
.vsbuild/
23+
.vscode/
24+
25+
# This is a staging directory used to upload the documents to gihub.io
26+
github-io-staging/
27+
28+
# Ignore Visual Studio Code files.
29+
.vscode/

Diff for: BUILD

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
package(default_visibility = ["//visibility:public"])
16+
17+
licenses(["notice"]) # Apache 2.0
18+
19+
exports_files([
20+
"LICENSE",
21+
])

Diff for: CMakeLists.txt

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# ~~~
2+
# Copyright 2020 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
# ~~~
16+
17+
cmake_minimum_required(VERSION 3.5)
18+
project(google-cloud-cpp-pubsub CXX C)
19+
20+
set(GOOGLE_CLOUD_CPP_CXX_STANDARD
21+
11
22+
CACHE STRING "Configure CMAKE_CXX_STANDARD")
23+
mark_as_advanced(GOOGLE_CLOUD_CPP_CXX_STANDARD)
24+
25+
set(CMAKE_CXX_STANDARD "${GOOGLE_CLOUD_CPP_CXX_STANDARD}")
26+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
27+
28+
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
29+
30+
# If possible, enable a code coverage build type.
31+
include(EnableCoverage)
32+
include(SelectMSVCRuntime)
33+
34+
# C++ Exceptions are enabled by default, but allow the user to turn them off.
35+
include(EnableCxxExceptions)
36+
37+
# This should be included from the top level CMakeLists file
38+
set(GOOGLE_CLOUD_CPP_PUBSUB_CLIENT_VERSION_MAJOR 0)
39+
set(GOOGLE_CLOUD_CPP_PUBSUB_CLIENT_VERSION_MINOR 1)
40+
set(GOOGLE_CLOUD_CPP_PUBSUB_CLIENT_VERSION_PATCH 0)
41+
string(CONCAT GOOGLE_CLOUD_CPP_PUBSUB_CLIENT_VERSION
42+
"${GOOGLE_CLOUD_CPP_PUBSUB_CLIENT_VERSION_MAJOR}" "."
43+
"${GOOGLE_CLOUD_CPP_PUBSUB_CLIENT_VERSION_MINOR}" "."
44+
"${GOOGLE_CLOUD_CPP_PUBSUB_CLIENT_VERSION_PATCH}")
45+
46+
include(CTest)
47+
48+
add_subdirectory(google/cloud/pubsub)

Diff for: CODE_OF_CONDUCT.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Contributor Code of Conduct
2+
3+
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4+
5+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
6+
7+
Examples of unacceptable behavior by participants include:
8+
9+
* The use of sexualized language or imagery
10+
* Personal attacks
11+
* Trolling or insulting/derogatory comments
12+
* Public or private harassment
13+
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
14+
* Other unethical or unprofessional conduct
15+
16+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
17+
18+
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
19+
20+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
21+
22+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.2.0, available at https://www.contributor-covenant.org/version/1/2/0/code-of-conduct.html
23+

Diff for: CONTRIBUTING.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# How to become a contributor and submit your own code
2+
3+
## Contributor License Agreements
4+
5+
We'd love to accept your patches! Before we can take them, we
6+
have to jump a couple of legal hurdles.
7+
8+
Please fill out either the individual or corporate Contributor License Agreement
9+
(CLA).
10+
11+
* If you are an individual writing original source code and you're sure you
12+
own the intellectual property, then you'll need to sign an
13+
[individual CLA](https://developers.google.com/open-source/cla/individual).
14+
* If you work for a company that wants to allow you to contribute your work,
15+
then you'll need to sign a
16+
[corporate CLA](https://developers.google.com/open-source/cla/corporate).
17+
18+
Follow either of the two links above to access the appropriate CLA and
19+
instructions for how to sign and return it. Once we receive it, we'll be able to
20+
accept your pull requests.
21+
22+
## Contributing A Patch
23+
24+
1. Submit an issue describing your proposed change to the repo in question.
25+
1. The repo owner will respond to your issue promptly.
26+
1. If your proposed change is accepted, and you haven't already done so, sign a
27+
Contributor License Agreement (see details above).
28+
1. Fork the desired repo, develop and test your code changes.
29+
1. Ensure that your code adheres to the existing style in the sample to which
30+
you are contributing.
31+
1. Ensure that your code has an appropriate set of unit tests which all pass.
32+
1. Submit a pull request.
33+
34+
## Style
35+
36+
This repository follow the [Google C++ Style Guide](
37+
https://google.github.io/styleguide/cppguide.html).
38+
Please make sure your contributions adhere to the style guide.
39+
40+
### Formatting
41+
42+
The code in this project is formatted with `clang-format(1)`, and our CI builds
43+
will check that the code matches the format generated by this tool before
44+
accepting a pull request. Please configure your editor or IDE to use the Google
45+
style for indentation and other whitespace. If you need to reformat one or more
46+
files, you can simply run `clang-format` manually:
47+
48+
```console
49+
$ clang-format -i <file>....
50+
```
51+
52+
If you need to reformat one of the files to match the Google style. Please be
53+
advised that `clang-format` has been known to generate slightly different
54+
formatting in different versions. We use version 7; use the same version if you
55+
run into problems.

0 commit comments

Comments
 (0)