Skip to content

Commit

Permalink
deploying pre-commit + lint
Browse files Browse the repository at this point in the history
  • Loading branch information
DasVinch committed Jan 18, 2022
1 parent 71a1847 commit c6964f5
Show file tree
Hide file tree
Showing 396 changed files with 20,460 additions and 31,383 deletions.
136 changes: 136 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: false
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
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
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: false
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: 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
SpaceBeforeSquareBrackets: false
Standard: Latest
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseCRLF: false
UseTab: Never
...
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
exclude: "^.github/"
repos:
- repo: https://github.com/pre-commit/mirrors-yapf.git
rev: v0.32.0
hooks:
- id: yapf
additional_dependencies: [toml]
- repo: https://github.com/pre-commit/mirrors-clang-format.git
rev: v13.0.0
hooks:
- id: clang-format
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v4.1.0
hooks:
- id: trailing-whitespace
exclude: \.fits
- id: end-of-file-fixer
exclude: \.fits
- id: check-yaml
- id: debug-statements
- id: requirements-txt-fixer
- id: check-added-large-files
- id: check-ast
- id: check-merge-conflict
#- repo: git://github.com/detailyang/pre-commit-shell
# rev: v1.0.6
# hooks:
# - id: shell-lint
#- repo: https://github.com/lovesegfault/beautysh.git
# rev: v6.2.1
# hooks:
# - id: beautysh
182 changes: 182 additions & 0 deletions .style.yapf
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
[style]
# Custom stylesheet for COMPASS python code
# Relatively relax policy, trying to make nice, compact, complete lines

# Align closing bracket with visual indentation.
align_closing_bracket_with_visual_indent = True

# Allow dictionary keys to exist on multiple lines. For example:
#
# x = {
# ('this is the first element of a tuple',
# 'this is the second element of a tuple'):
# value,
# }
allow_multiline_dictionary_keys = True

# Allow lambdas to be formatted on more than one line.
allow_multiline_lambdas = True

# Insert a blank line before a class-level docstring.
blank_line_before_class_docstring = False

# Insert a blank line before a 'def' or 'class' immediately nested
# within another 'def' or 'class'. For example:
#
# class Foo:
# # <------ this blank line
# def method():
# ...
blank_line_before_nested_class_or_def = True

# Do not split consecutive brackets. Only relevant when
# dedent_closing_brackets is set. For example:
#
# call_func_that_takes_a_dict(
# {
# 'key1': 'value1',
# 'key2': 'value2',
# }
# )
#
# would reformat to:
#
# call_func_that_takes_a_dict({
# 'key1': 'value1',
# 'key2': 'value2',
# })
coalesce_brackets = True

# The column limit.
column_limit = 79

# Indent width used for line continuations.
continuation_indent_width = 8

# Put closing brackets on a separate line, dedented, if the bracketed
# expression can't fit in a single line. Applies to all kinds of brackets,
# including function definitions and calls. For example:
#
# config = {
# 'key1': 'value1',
# 'key2': 'value2',
# } # <--- this bracket is dedented and on a separate line
#
# time_series = self.remote_client.query_entity_counters(
# entity='dev3246.region1',
# key='dns.query_latency_tcp',
# transform=Transformation.AVERAGE(window=timedelta(seconds=60)),
# start_ts=now()-timedelta(days=3),
# end_ts=now(),
# ) # <--- this bracket is dedented and on a separate line
dedent_closing_brackets = False

# Place each dictionary entry onto its own line.
each_dict_entry_on_separate_line = True

# The regex for an i18n comment. The presence of this comment stops
# reformatting of that line, because the comments are required to be
# next to the string they translate.
i18n_comment=

# The i18n function call names. The presence of this function stops
# reformattting on that line, because the string it has cannot be moved
# away from the i18n comment.
i18n_function_call=

# Indent the dictionary value if it cannot fit on the same line as the
# dictionary key. For example:
#
# config = {
# 'key1':
# 'value1',
# 'key2': value1 +
# value2,
# }
indent_dictionary_value = True

# The number of columns to use for indentation.
indent_width=4

# Join short lines into one line. E.g., single line 'if' statements.
join_multiple_lines = True

# Use spaces around default or named assigns.
spaces_around_default_or_named_assign = False

# Use spaces around the power operator.
spaces_around_power_operator = False

# The number of spaces required before a trailing comment.
spaces_before_comment = 2

# Insert a space between the ending comma and closing bracket of a list,
# etc.
space_between_ending_comma_and_closing_bracket = True

# Split before arguments if the argument list is terminated by a
# comma.
split_arguments_when_comma_terminated = False

# Set to True to prefer splitting before '&', '|' or '^' rather than
# after.
split_before_bitwise_operator = False

# Split before a dictionary or set generator (comp_for). For example, note
# the split before the 'for':
#
# foo = {
# variable: 'Hello world, have a nice day!'
# for variable in bar if variable != 42
# }
split_before_dict_set_generator = True

# If an argument / parameter list is going to be split, then split before
# the first argument.
split_before_first_argument = False

# Set to True to prefer splitting before 'and' or 'or' rather than
# after.
split_before_logical_operator = False

# Split named assignments onto individual lines.
split_before_named_assigns = False

# The penalty for splitting right after the opening bracket.
split_penalty_after_opening_bracket = 2600

# The penalty for splitting the line after a unary operator.
split_penalty_after_unary_operator = 10000

# The penalty for splitting right before an if expression.
split_penalty_before_if_expr = 0

# The penalty of splitting the line around the '&', '|', and '^'
# operators.
split_penalty_bitwise_operator = 300

# The penalty for characters over the column limit.
split_penalty_excess_character = 4000

# The penalty incurred by adding a line split to the unwrapped line. The
# more line splits added the higher the penalty.
split_penalty_for_added_line_split = 150

# The penalty of splitting a list of "import as" names. For example:
#
# from a_very_long_or_indented_module_name_yada_yad import (long_argument_1,
# long_argument_2,
# long_argument_3)
#
# would reformat to something like:
#
# from a_very_long_or_indented_module_name_yada_yad import (
# long_argument_1, long_argument_2, long_argument_3)
split_penalty_import_names = 0

# The penalty of splitting the line around the 'and' and 'or'
# operators.
split_penalty_logical_operator = 300

# Use the Tab character for indentation.
use_tabs = False
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,3 @@ script:
- export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${MILK_INSTALLDIR}/lib/pkgconfig
- ls -l /usr/local/milk/bin/
- ctest -D Experimental

1 change: 0 additions & 1 deletion CTestConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@ set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "my.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=milk-core")
set(CTEST_DROP_SITE_CDASH TRUE)

2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,3 @@ Compile with coffee plugins:

./fetch_coffee_dev.sh
./compile.sh $PWD/local


Loading

0 comments on commit c6964f5

Please sign in to comment.