Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
BasedOnStyle: LLVM
IndentWidth: 4
IndentWidth: 2
PointerAlignment: Left
ColumnLimit: 100
AccessModifierOffset: -2
65 changes: 65 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
# Configure clang-tidy for this project.

# Disabled:
# -google-readability-namespace-comments the *_CLIENT_NS is a macro, and
# clang-tidy fails to match it against the initial value.
Checks: >
-*,
bugprone-*,
google-*,
misc-*,
modernize-*,
performance-*,
portability-*,
readability-*,
-modernize-use-trailing-return-type,
-bugprone-implicit-widening-of-multiplication-result,
-modernize-avoid-c-arrays,
-readability-identifier-length,
-misc-non-private-member-variables-in-classes,

# -google-readability-namespace-comments,
# -google-runtime-int,
# -google-runtime-references,
# -misc-non-private-member-variables-in-classes,
# -readability-named-parameter,
# -readability-braces-around-statements,
# -readability-magic-numbers,
#
# Turn all the warnings from the checks above into errors.
WarningsAsErrors: "*"

CheckOptions:
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
- { key: readability-identifier-naming.StructCase, value: CamelCase }
- { key: readability-identifier-naming.TemplateParameterCase, value: CamelCase }
- { key: readability-identifier-naming.FunctionCase, value: lower_case }
- { key: readability-identifier-naming.VariableCase, value: lower_case }
- { key: readability-identifier-naming.PrivateMemberPrefix, value: _ }
- { key: readability-identifier-naming.ProtectedMemberPrefix, value: _ }
- { key: readability-identifier-naming.MacroDefinitionCase, value: UPPER_CASE }
- { key: readability-identifier-naming.EnumConstantCase, value: CamelCase }
- { key: readability-identifier-naming.EnumConstantPrefix, value: k }
- { key: readability-identifier-naming.ConstexprVariableCase, value: CamelCase }
- { key: readability-identifier-naming.ConstexprVariablePrefix, value: k }
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
- { key: readability-identifier-naming.MemberConstantCase, value: CamelCase }
- { key: readability-identifier-naming.MemberConstantPrefix, value: k }
- { key: readability-identifier-naming.StaticConstantCase, value: CamelCase }
- { key: readability-identifier-naming.StaticConstantPrefix, value: k }
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ project(mcpp VERSION ${PROJECT_VERSION})

set(CMAKE_CXX_STANDARD 17)

# Used for clang-tidy
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
Expand Down Expand Up @@ -72,3 +75,5 @@ target_link_libraries(video_mc ${PROJECT_NAME})
target_link_libraries(obj_mc ${PROJECT_NAME})

add_custom_target(examples DEPENDS hello_minecraft pyramid game_of_life minesweeper video_mc obj_mc)


1 change: 1 addition & 0 deletions example/.clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Checks: "-*"
Loading