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
60 changes: 20 additions & 40 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,54 +1,40 @@
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# https://releases.llvm.org/9.0.0/tools/clang/docs/ClangFormatStyleOptions.html
# https://releases.llvm.org/10.0.0/tools/clang/docs/ClangFormatStyleOptions.html

---
# Language: Cpp

BasedOnStyle: LLVM

# AccessModifierOffset: -2
AccessModifierOffset: -4

# AlignAfterOpenBracket: Align
AlignAfterOpenBracket: DontAlign

# AlignConsecutiveMacros: false
AlignConsecutiveMacros: true

# AlignConsecutiveAssignments: false
AlignConsecutiveAssignments: true

# AlignConsecutiveDeclarations: false

# AlignEscapedNewlines: Right
AlignEscapedNewlines: Left

# AlignOperands: true

# AlignTrailingComments: true
AlignTrailingComments: false

# AllowAllArgumentsOnNextLine: true
# AllowAllConstructorInitializersOnNextLine: true
# AllowAllParametersOfDeclarationOnNextLine: true
# AllowShortBlocksOnASingleLine: false
# AllowShortBlocksOnASingleLine: Never
# AllowShortCaseLabelsOnASingleLine: false

# AllowShortFunctionsOnASingleLine: All
AllowShortFunctionsOnASingleLine: Empty

# AllowShortLambdasOnASingleLine: All
# AllowShortIfStatementsOnASingleLine: Never
# AllowShortLoopsOnASingleLine: false
# AlwaysBreakAfterDefinitionReturnType: None
# AlwaysBreakAfterReturnType: None
# AlwaysBreakBeforeMultilineStrings: false

# AlwaysBreakTemplateDeclarations: MultiLine
AlwaysBreakTemplateDeclarations: Yes

# BinPackArguments: true
# BinPackParameters: true
# BraceWrapping:
Expand All @@ -68,10 +54,8 @@ AlwaysBreakTemplateDeclarations: Yes
# SplitEmptyFunction: true
# SplitEmptyRecord: true
# SplitEmptyNamespace: true

# BreakBeforeBinaryOperators: None
BreakBeforeBinaryOperators: NonAssignment

# BreakBeforeBraces: Attach
# BreakBeforeInheritanceComma: false
# BreakInheritanceList: BeforeColon
Expand All @@ -80,16 +64,16 @@ BreakBeforeBinaryOperators: NonAssignment
# BreakConstructorInitializers: BeforeColon
# BreakAfterJavaFieldAnnotations: false
# BreakStringLiterals: true

# ColumnLimit: 80
ColumnLimit: 120

# CommentPragmas: '^ IWYU pragma:'
# CompactNamespaces: false
# ConstructorInitializerAllOnOneLineOrOnePerLine: false
# ConstructorInitializerIndentWidth: 4
# ContinuationIndentWidth: 4
# Cpp11BracedListStyle: true
# DeriveLineEnding: true
DeriveLineEnding: false
# DerivePointerAlignment: false
# DisableFormat: false
# ExperimentalAutoDetectBinPacking: false
Expand All @@ -98,55 +82,52 @@ ColumnLimit: 120
# - foreach
# - Q_FOREACH
# - BOOST_FOREACH

# IncludeBlocks: Preserve
IncludeBlocks: Regroup

# IncludeCategories:
# - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
# Priority: 2
# SortPriority: 0
# - Regex: '^(<|"(gtest|gmock|isl|json)/)'
# Priority: 3
# SortPriority: 0
# - Regex: '.*'
# Priority: 1
# SortPriority: 0
IncludeCategories:
- Regex: '^<yvals(_core)?\.h>$'
Priority: 1
- Regex: '^<(Windows|userenv)\.h>$'
Priority: 3
SortPriority: 3
- Regex: '^<WinIoCtl\.h>$'
Priority: 4
Priority: 3
SortPriority: 4
- Regex: '^<__.*\.hpp>$'
Priority: 2
- Regex: '\.hpp[>"]$'
Priority: 5
- Regex: '.*'
Priority: 2

# IncludeIsMainRegex: '(Test)?$'
# IncludeIsMainSourceRegex: ''
# IndentCaseLabels: false
# IndentGotoLabels: true
# IndentPPDirectives: None

# IndentWidth: 2
IndentWidth: 4

# IndentWrappedFunctionNames: false
IndentWrappedFunctionNames: true

# JavaScriptQuotes: Leave
# JavaScriptWrapImports: true
# KeepEmptyLinesAtTheStartOfBlocks: true

# NOTE: MacroBlockBegin/MacroBlockEnd don't work with _CATCH_ALL.
# MacroBlockBegin: ''
# MacroBlockEnd: ''

# MaxEmptyLinesToKeep: 1
MaxEmptyLinesToKeep: 2

# NamespaceIndentation: None
NamespaceIndentation: All

# ObjCBinPackProtocolList: Auto
# ObjCBlockIndentWidth: 2
# ObjCSpaceAfterProperty: false
Expand All @@ -159,17 +140,13 @@ NamespaceIndentation: All
# PenaltyBreakTemplateDeclaration: 10
# PenaltyExcessCharacter: 1000000
# PenaltyReturnTypeOnItsOwnLine: 60

# PointerAlignment: Right
PointerAlignment: Left

# ReflowComments: true
# SortIncludes: true
# SortUsingDeclarations: true

# SpaceAfterCStyleCast: false
SpaceAfterCStyleCast: true

# SpaceAfterLogicalNot: false
# SpaceAfterTemplateKeyword: true
# SpaceBeforeAssignmentOperators: true
Expand All @@ -178,20 +155,22 @@ SpaceAfterCStyleCast: true
# SpaceBeforeInheritanceColon: true
# SpaceBeforeParens: ControlStatements
# SpaceBeforeRangeBasedForLoopColon: true
# SpaceInEmptyBlock: false
# SpaceInEmptyParentheses: false
# SpacesBeforeTrailingComments: 1
# SpacesInAngles: false
# SpacesInConditionalStatement: false
# SpacesInContainerLiterals: true
# SpacesInCStyleCastParentheses: false
# SpacesInParentheses: false
# SpacesInSquareBrackets: false
# Standard: Cpp11

# NOTE: _STD_BEGIN, _STD_END, etc. aren't macros for complete statements, but telling clang-format that they are
# produces the behavior that we want (with no block indentation).
# SpaceBeforeSquareBrackets: false
# Standard: Latest
# StatementMacros:
# - Q_UNUSED
# - QT_REQUIRE_VERSION
# NOTE: _STD_BEGIN, _STD_END, etc. aren't macros for complete statements, but telling
# clang-format that they are produces the behavior that we want (with no block indentation).
StatementMacros:
- _STD_BEGIN
- _STD_END
Expand All @@ -201,7 +180,8 @@ StatementMacros:
- _END_EXTERN_C
- _EXTERN_C_UNLESS_PURE
- _END_EXTERN_C_UNLESS_PURE

# TabWidth: 8
# UseCRLF: false
UseCRLF: true
# UseTab: Never
...
1 change: 0 additions & 1 deletion stl/src/filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <xfilesystem_abi.h>

#include <Windows.h>

#include <WinIoCtl.h>

// We have several switches that do not have case statements for every possible enum value.
Expand Down
2 changes: 1 addition & 1 deletion tests/std/tests/P0896R4_ranges_alg_is_permutation/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <ranges>
#include <span>
#include <utility>
//

#include <range_algorithm_support.hpp>

using namespace std;
Expand Down
2 changes: 1 addition & 1 deletion tests/std/tests/P0896R4_ranges_alg_search/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include <ranges>
#include <span>
#include <utility>
//

#include <range_algorithm_support.hpp>

using namespace std;
Expand Down
2 changes: 1 addition & 1 deletion tests/std/tests/P0896R4_ranges_range_machinery/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <utility>
#include <valarray>
#include <vector>
//

#include <range_algorithm_support.hpp>

// Note that many tests herein assume:
Expand Down
2 changes: 1 addition & 1 deletion tools/inc/stljobs.h
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ class thread_proc_attribute_list {
thread_proc_attribute_list& operator=(thread_proc_attribute_list&&) = default;

explicit thread_proc_attribute_list(const unsigned long attributeCount) {
size_t size;
SIZE_T size;
if (InitializeProcThreadAttributeList(nullptr, attributeCount, 0, &size)) {
fputs("First call to InitializeProcThreadAttributeList should not succeed.", stderr);
abort();
Expand Down