Skip to content

Instantly share code, notes, and snippets.

@mwilliammyers
Last active August 30, 2019 00:17
Show Gist options
  • Save mwilliammyers/78de7162542802e80eee5607f00836d0 to your computer and use it in GitHub Desktop.
Save mwilliammyers/78de7162542802e80eee5607f00836d0 to your computer and use it in GitHub Desktop.
Sublime Text settings
[
{
"command": "show_panel",
"args": {
"panel": "output.exec"
},
"caption": "Show Build Results"
}
]
[
{ "keys": ["primary+alt+s"], "command": "save_all" },
{ "keys": ["primary+alt+/"], "command": "toggle_fold_comments" },
{ "keys": ["primary+alt+w"], "command": "close_all" },
{
"keys": ["primary+k", "primary+d"],
"command": "show_panel",
// TODO: does not actually toggle...
"args": { "panel": "output.diagnostics", "toggle": true },
"context": [
// TODO: should be if lsp is enabled
{
"key": "selector",
"operator": "not_equal",
"operand": "source.rust | source.rs | source.python"
}
]
},
{ "keys": ["alt+shift+a"], "command": "lsp_code_actions" },
{ "keys": ["alt+space"], "command": "lsp_code_actions" },
{
"keys": ["alt+shift+d"],
"command": "show_panel",
// TODO: does not actually toggle...
"args": { "panel": "output.diagnostics", "toggle": true },
"context": [
// TODO: should be if lsp is enabled
{
"key": "selector",
"operator": "not_equal",
"operand": "source.rust | source.rs | source.python"
}
]
},
{
"keys": ["primary+k", "primary+d"],
// toggles the diagnostics panel
"command": "lsp_show_diagnostics_panel",
"context": [
// TODO: should be if lsp is enabled
{
"key": "selector",
"operator": "equal",
"operand": "source.rust | source.rs | source.python"
}
]
},
{
"keys": ["alt+shift+d"],
"command": "lsp_show_diagnostics_panel",
"context": [
// TODO: should be if lsp is enabled
{
"key": "selector",
"operator": "equal",
"operand": "source.rust | source.rs | source.python"
}
]
},
// {
// "keys": ["primary+r"],
// "command": "lsp_document_symbols",
// "context": [
// // TODO: should be if lsp is enabled
// {
// "key": "selector",
// "operator": "equal",
// "operand": "source.rust | source.rs | source.python"
// }
// ]
// },
// Formatting
{
"keys": ["alt+shift+f"],
"command": "lsp_format_document",
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "source.python"
}
]
},
// Do not use lsp_format_document; it has to wait for the build to succeed
// see: https://github.com/rust-lang/rls/issues/1148
{
"keys": ["alt+shift+f"],
// "command": "rust_format_file", // RustFormat package
"command": "rust_fmt_format_buffer", // RustFmt package
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "source.rust | source.rs"
}
]
},
// TODO: all of this is ridiculous, there has to be a better way...
// {
// // TODO: run_format for rustfmt does not work...
// "keys": ["alt+shift+f"],
// "command": "run_format",
// "args": { "identifier": "rustfmt" },
// "context": [
// {
// "key": "selector",
// "operator": "equal",
// "operand": "source.rust | source.rs"
// }
// ]
// },
{
"keys": ["alt+shift+f"],
"command": "run_format",
"args": { "identifier": "prettier" },
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "source.js | source.jsx | source.ts | source.tsx | source.css | source.scss | source.less | source.json | source.json.sublime | source.html | source.graphql | source.markdown | source.toml | source.vue | source.yaml"
}
]
},
{
"keys": ["alt+shift+f"],
"command": "run_format",
"args": { "identifier": "beautysh" },
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "source.bash"
}
]
},
{
"keys": ["alt+shift+f"],
"command": "run_format",
"args": { "identifier": "clangformat" },
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "source.c | source.c++ | source.objc | source.objc++ | source.java | source.proto"
}
]
},
{
"keys": ["alt+shift+f"],
"command": "run_format",
"args": { "identifier": "rubocop" },
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "source.ruby"
}
]
},
{
"keys": ["alt+shift+f"],
"command": "run_format",
"args": { "identifier": "perltidy" },
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "source.perl"
}
]
},
{
"keys": ["alt+shift+f"],
"command": "run_format",
"args": { "identifier": "phpcsfixer" },
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "source.php"
}
]
}
]
[
{
"button": "button1",
"count": 1,
"modifiers": ["alt"],
"press_command": "drag_select",
"command": "lsp_symbol_definition",
},
{
"button": "button2",
"count": 1,
"modifiers": ["alt"],
"command": "jump_back"
}
]
{
"extensions":
[
"fish"
]
}
{
"indent-size": 4,
"tab": false,
"backup": false
}
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: 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
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth: 2
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: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 8
UseTab: Never
...
{
"compatibility": {
// Accepted option: "ie7", "ie8", "ie9" or "*"; default ie10+: "*"
"*": {
"colors.opacity": true,
"properties.backgroundClipMerging": true,
"properties.backgroundOriginMerging": true,
"properties.backgroundSizeMerging": true,
"properties.colors": true,
"properties.ieBangHack": false,
"properties.ieFilters": false,
"properties.iePrefixHack": false,
"properties.ieSuffixHack": false,
"properties.merging": true,
"properties.shorterLengthUnits": false,
"properties.spaceAfterClosingBrace": true,
"properties.urlQuotes": false,
"properties.zeroUnits": true,
"selectors.adjacentSpace": false,
"selectors.ie7Hack": false,
"selectors.multiplePseudoMerging": true,
"units.ch": true,
"units.in": true,
"units.pc": true,
"units.pt": true,
"units.rem": true,
"units.vh": true,
"units.vm": true,
"units.vmax": true,
"units.vmin": true,
"units.vw": true
}
},
"format": {
// Accepted option: "beautify", "keep-breaks" or ""; default: ""
"": {
"breaks:afterAtRule": false,
"breaks:afterBlockBegins": false,
"breaks:afterBlockEnds": false,
"breaks:afterComment": false,
"breaks:afterProperty": false,
"breaks:afterRuleBegins": false,
"breaks:afterRuleEnds": false,
"breaks:beforeBlockEnds": false,
"breaks:betweenSelectors": false,
"breakWith": "lf",
"indentBy": 0,
"indentWith": "space",
"spaces:aroundSelectorRelation": false,
"spaces:beforeBlockBegins": false,
"spaces:beforeValue": false,
"wrapAt": false
}
},
"inline": ["local"],
"inline-timeout": 5,
"skip-rebase": false,
"optimization": {
// Accepted level: "0", "1", "2"; default: "1"
"level": ["1"],
"1": {
"cleanupCharsets": true,
"normalizeUrls": true,
"optimizeBackground": true,
"optimizeBorderRadius": true,
"optimizeFilter": true,
"optimizeFontWeight": true,
"optimizeOutline": true,
"removeEmpty": true,
"removeNegativePaddings": true,
"removeQuotes": true,
"removeWhitespace": true,
"replaceMultipleZeros": true,
"replaceTimeUnits": true,
"replaceZeroUnits": true,
"roundingPrecision": false,
"selectorsSortingMethod": "standard",
"specialComments": "all",
"tidyAtRules": true,
"tidyBlockScopes": true,
"tidySelectors": true
},
"2": {
"mergeAdjacentRules": true,
"mergeIntoShorthands": true,
"mergeMedia": true,
"mergeNonAdjacentRules": true,
"mergeSemantically": false,
"overrideProperties": true,
"removeEmpty": true,
"reduceNonAdjacentRules": true,
"removeDuplicateFontRules": true,
"removeDuplicateMediaBlocks": true,
"removeDuplicateRules": true,
"removeUnusedAtRules": false,
"restructureRules": false,
"skipProperties": []
}
}
}
{
"always-semicolon": true,
"block-indent": 4,
"color-case": "upper",
"color-shorthand": false,
"element-case": "lower",
"eof-newline": true,
"leading-zero": true,
"quotes": "single",
"remove-empty-rulesets": false,
"space-after-colon": 1,
"space-after-combinator": 1,
"space-after-opening-brace": "\n",
"space-after-selector-delimiter": "\n",
"space-before-closing-brace": "\n",
"space-before-colon": 0,
"space-before-combinator": 1,
"space-before-opening-brace": 1,
"space-before-selector-delimiter": 0,
"space-between-declarations": "\n",
"strip-spaces": true,
"unitless-zero": true,
"vendor-prefix-align": true,
"lines-between-rulesets": 1,
"tab-size": 4,
"sort-order": [
[
"font",
"font-family",
"font-size",
"font-weight",
"font-style",
"font-variant",
"font-size-adjust",
"font-stretch",
"font-effect",
"font-emphasize",
"font-emphasize-position",
"font-emphasize-style",
"font-smooth",
"line-height"
],
[
"position",
"z-index",
"top",
"right",
"bottom",
"left"
],
[
"display",
"visibility",
"float",
"clear",
"overflow",
"overflow-x",
"overflow-y",
"-ms-overflow-x",
"-ms-overflow-y",
"clip",
"zoom",
"-webkit-align-content",
"-ms-flex-line-pack",
"align-content",
"-webkit-box-align",
"-moz-box-align",
"-webkit-align-items",
"align-items",
"-ms-flex-align",
"-webkit-align-self",
"-ms-flex-item-align",
"-ms-grid-row-align",
"align-self",
"-webkit-box-flex",
"-webkit-flex",
"-moz-box-flex",
"-ms-flex",
"flex",
"-webkit-flex-flow",
"-ms-flex-flow",
"flex-flow",
"-webkit-flex-basis",
"-ms-flex-preferred-size",
"flex-basis",
"-webkit-box-orient",
"-webkit-box-direction",
"-webkit-flex-direction",
"-moz-box-orient",
"-moz-box-direction",
"-ms-flex-direction",
"flex-direction",
"-webkit-flex-grow",
"-ms-flex-positive",
"flex-grow",
"-webkit-flex-shrink",
"-ms-flex-negative",
"flex-shrink",
"-webkit-flex-wrap",
"-ms-flex-wrap",
"flex-wrap",
"-webkit-box-pack",
"-moz-box-pack",
"-ms-flex-pack",
"-webkit-justify-content",
"justify-content",
"-webkit-box-ordinal-group",
"-webkit-order",
"-moz-box-ordinal-group",
"-ms-flex-order",
"order"
],
[
"-webkit-box-sizing",
"-moz-box-sizing",
"box-sizing",
"width",
"min-width",
"max-width",
"height",
"min-height",
"max-height",
"margin",
"margin-top",
"margin-right",
"margin-bottom",
"margin-left",
"padding",
"padding-top",
"padding-right",
"padding-bottom",
"padding-left"
],
[
"table-layout",
"empty-cells",
"caption-side",
"border-spacing",
"border-collapse",
"list-style",
"list-style-position",
"list-style-type",
"list-style-image"
],
[
"content",
"quotes",
"counter-reset",
"counter-increment",
"resize",
"cursor",
"-webkit-user-select",
"-moz-user-select",
"-ms-user-select",
"user-select",
"nav-index",
"nav-up",
"nav-right",
"nav-down",
"nav-left",
"-webkit-transition",
"-moz-transition",
"-ms-transition",
"-o-transition",
"transition",
"-webkit-transition-delay",
"-moz-transition-delay",
"-ms-transition-delay",
"-o-transition-delay",
"transition-delay",
"-webkit-transition-timing-function",
"-moz-transition-timing-function",
"-ms-transition-timing-function",
"-o-transition-timing-function",
"transition-timing-function",
"-webkit-transition-duration",
"-moz-transition-duration",
"-ms-transition-duration",
"-o-transition-duration",
"transition-duration",
"-webkit-transition-property",
"-moz-transition-property",
"-ms-transition-property",
"-o-transition-property",
"transition-property",
"-webkit-transform",
"-moz-transform",
"-ms-transform",
"-o-transform",
"transform",
"-webkit-transform-origin",
"-moz-transform-origin",
"-ms-transform-origin",
"-o-transform-origin",
"transform-origin",
"-webkit-animation",
"-moz-animation",
"-ms-animation",
"-o-animation",
"animation",
"-webkit-animation-name",
"-moz-animation-name",
"-ms-animation-name",
"-o-animation-name",
"animation-name",
"-webkit-animation-duration",
"-moz-animation-duration",
"-ms-animation-duration",
"-o-animation-duration",
"animation-duration",
"-webkit-animation-play-state",
"-moz-animation-play-state",
"-ms-animation-play-state",
"-o-animation-play-state",
"animation-play-state",
"-webkit-animation-timing-function",
"-moz-animation-timing-function",
"-ms-animation-timing-function",
"-o-animation-timing-function",
"animation-timing-function",
"-webkit-animation-delay",
"-moz-animation-delay",
"-ms-animation-delay",
"-o-animation-delay",
"animation-delay",
"-webkit-animation-iteration-count",
"-moz-animation-iteration-count",
"-ms-animation-iteration-count",
"-o-animation-iteration-count",
"animation-iteration-count",
"-webkit-animation-direction",
"-moz-animation-direction",
"-ms-animation-direction",
"-o-animation-direction",
"animation-direction",
"text-align",
"-webkit-text-align-last",
"-moz-text-align-last",
"-ms-text-align-last",
"text-align-last",
"vertical-align",
"white-space",
"text-decoration",
"text-emphasis",
"text-emphasis-color",
"text-emphasis-style",
"text-emphasis-position",
"text-indent",
"-ms-text-justify",
"text-justify",
"letter-spacing",
"word-spacing",
"-ms-writing-mode",
"text-outline",
"text-transform",
"text-wrap",
"text-overflow",
"-ms-text-overflow",
"text-overflow-ellipsis",
"text-overflow-mode",
"-ms-word-wrap",
"word-wrap",
"word-break",
"-ms-word-break",
"-moz-tab-size",
"-o-tab-size",
"tab-size",
"-webkit-hyphens",
"-moz-hyphens",
"hyphens",
"pointer-events"
],
[
"opacity",
"filter:progid:DXImageTransform.Microsoft.Alpha(Opacity",
"-ms-filter:\\'progid:DXImageTransform.Microsoft.Alpha",
"-ms-interpolation-mode",
"color",
"border",
"border-width",
"border-style",
"border-color",
"border-top",
"border-top-width",
"border-top-style",
"border-top-color",
"border-right",
"border-right-width",
"border-right-style",
"border-right-color",
"border-bottom",
"border-bottom-width",
"border-bottom-style",
"border-bottom-color",
"border-left",
"border-left-width",
"border-left-style",
"border-left-color",
"-webkit-border-radius",
"-moz-border-radius",
"border-radius",
"-webkit-border-top-left-radius",
"-moz-border-radius-topleft",
"border-top-left-radius",
"-webkit-border-top-right-radius",
"-moz-border-radius-topright",
"border-top-right-radius",
"-webkit-border-bottom-right-radius",
"-moz-border-radius-bottomright",
"border-bottom-right-radius",
"-webkit-border-bottom-left-radius",
"-moz-border-radius-bottomleft",
"border-bottom-left-radius",
"-webkit-border-image",
"-moz-border-image",
"-o-border-image",
"border-image",
"-webkit-border-image-source",
"-moz-border-image-source",
"-o-border-image-source",
"border-image-source",
"-webkit-border-image-slice",
"-moz-border-image-slice",
"-o-border-image-slice",
"border-image-slice",
"-webkit-border-image-width",
"-moz-border-image-width",
"-o-border-image-width",
"border-image-width",
"-webkit-border-image-outset",
"-moz-border-image-outset",
"-o-border-image-outset",
"border-image-outset",
"-webkit-border-image-repeat",
"-moz-border-image-repeat",
"-o-border-image-repeat",
"border-image-repeat",
"outline",
"outline-width",
"outline-style",
"outline-color",
"outline-offset",
"background",
"filter:progid:DXImageTransform.Microsoft.AlphaImageLoader",
"background-color",
"background-image",
"background-repeat",
"background-attachment",
"background-position",
"background-position-x",
"-ms-background-position-x",
"background-position-y",
"-ms-background-position-y",
"-webkit-background-clip",
"-moz-background-clip",
"background-clip",
"background-origin",
"-webkit-background-size",
"-moz-background-size",
"-o-background-size",
"background-size",
"box-decoration-break",
"-webkit-box-shadow",
"-moz-box-shadow",
"box-shadow",
"filter:progid:DXImageTransform.Microsoft.gradient",
"-ms-filter:\\'progid:DXImageTransform.Microsoft.gradient",
"text-shadow"
]
]
}
{
"parserOptions": {
"ecmaVersion": 2018,
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module"
},
"env": {
"es6": true,
"node": true
},
"rules": {
"array-bracket-newline": "error",
"array-bracket-spacing": "error",
"array-element-newline": "error",
"arrow-body-style": "error",
"arrow-parens": "error",
"arrow-spacing": ["error", { "before": true, "after": true }],
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs"],
"capitalized-comments": "error",
"comma-dangle": ["error", {
"arrays": "never",
"objects": "never",
"imports": "never",
"exports": "never",
"functions": "never"
}],
"comma-spacing": ["error", { "before": false, "after": true }],
"comma-style": ["error", "last"],
"computed-property-spacing": "error",
"curly": ["error", "multi-line"],
"dot-location": ["error", "property"],
"dot-notation": "error",
"eol-last": "error",
"eqeqeq": ["error", "always", { "null": "ignore" }],
"func-call-spacing": ["error", "never"],
"function-paren-newline": "error",
"generator-star-spacing": ["error", { "before": true, "after": true }],
"implicit-arrow-linebreak": "error",
"indent": ["error", 4, {
"SwitchCase": 1,
"VariableDeclarator": 1,
"outerIIFEBody": 1,
"MemberExpression": 1,
"FunctionDeclaration": { "parameters": 1, "body": 1 },
"FunctionExpression": { "parameters": 1, "body": 1 },
"CallExpression": { "arguments": 1 },
"ArrayExpression": 1,
"ObjectExpression": 1,
"ImportDeclaration": 1,
"flatTernaryExpressions": false,
"ignoreComments": false
}],
"jsx-quotes": "error",
"key-spacing": ["error", { "beforeColon": false, "afterColon": true }],
"keyword-spacing": ["error", { "before": true, "after": true }],
"linebreak-style": "error",
"lines-around-comment": "error",
"lines-between-class-members": "error",
"multiline-comment-style": "error",
"new-parens": "error",
"newline-per-chained-call": "error",
"no-confusing-arrow": "error",
"no-else-return": "error",
"no-extra-bind": "error",
"no-extra-boolean-cast": "error",
"no-extra-label": "error",
"no-extra-parens": ["error", "functions"],
"no-extra-semi": "error",
"no-floating-decimal": "error",
"no-implicit-coercion": "error",
"no-lonely-if": "error",
"no-multi-spaces": "error",
"no-multiple-empty-lines": ["error", { "max": 1, "maxEOF": 0 }],
"no-regex-spaces": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-unneeded-ternary": ["error", { "defaultAssignment": false }],
"no-unsafe-negation": "error",
"no-unused-labels": "error",
"no-useless-computed-key": "error",
"no-useless-rename": "error",
"no-useless-return": "error",
"no-var": "error",
"no-whitespace-before-property": "error",
"nonblock-statement-body-position": "error",
"object-curly-newline": "error",
"object-curly-spacing": ["error", "always"],
"object-property-newline": ["error", { "allowMultiplePropertiesPerLine": true }],
"object-shorthand": "error",
"one-var-declaration-per-line": "error",
"one-var": ["error", { "initialized": "never" }],
"operator-assignment": "error",
"operator-linebreak": ["error", "after", { "overrides": { "?": "before", ":": "before" } }],
"padded-blocks": ["error", { "blocks": "never", "switches": "never", "classes": "never" }],
"padding-line-between-statements": "error",
"prefer-const": "error",
"prefer-numeric-literals": "error",
"prefer-object-spread": "error",
"prefer-spread": "error",
"prefer-template": "error",
"quote-props": "error",
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
"rest-spread-spacing": ["error", "never"],
"semi-spacing": ["error", { "before": false, "after": true }],
"semi-style": "error",
"semi": ["error", "always"],
"sort-imports": "error",
"sort-vars": "error",
"space-before-blocks": ["error", "always"],
"space-before-function-paren": ["error", "never"],
"space-in-parens": ["error", "never"],
"space-infix-ops": "error",
"space-unary-ops": ["error", { "words": true, "nonwords": false }],
"spaced-comment": ["error", "always", {
"line": { "markers": ["*package", "!", "/", ",", "="] },
"block": { "balanced": true, "markers": ["*package", "!", ",", ":", "::", "flow-include"], "exceptions": ["*"] }
}],
"strict": "error",
"switch-colon-spacing": "error",
"template-curly-spacing": ["error", "never"],
"template-tag-spacing": ["error", "never"],
"unicode-bom": ["error", "never"],
"valid-jsdoc": "error",
"wrap-iife": ["error", "any", { "functionPrototypeMethods": true }],
"wrap-regex": "error",
"yield-star-spacing": ["error", "both"],
"yoda": ["error", "never"]
}
}
{
"caseSensitive": false,
"collapseBooleanAttributes": true,
"collapseInlineTagWhitespace": false,
"collapseWhitespace": true,
"conservativeCollapse": false,
"customAttrAssign": [],
"customAttrCollapse": ".*",
"customAttrSurround": [],
"customEventAttributes": ["^on[a-z]{3,}$"],
"decodeEntities": true,
"html5": true,
"ignoreCustomComments": ["^!"],
"ignoreCustomFragments": [
"<#[\\s\\S]*?#>",
"<%[\\s\\S]*?%>",
"<\\?[\\s\\S]*?\\?>"
],
"includeAutoGeneratedTags": false,
"keepClosingSlash": false,
"maxLineLength": 0,
"minifyCSS": true,
"minifyJS": true,
"minifyURLs": true,
"preserveLineBreaks": false,
"preventAttributesEscaping": false,
"processConditionalComments": true,
"processScripts": [
"text/html"
],
"quoteCharacter": "\"",
"removeAttributeQuotes": true,
"removeComments": true,
"removeEmptyAttributes": true,
"removeEmptyElements": true,
"removeOptionalTags": true,
"removeRedundantAttributes": true,
"removeScriptTypeAttributes": true,
"removeStyleLinkTypeAttributes": true,
"removeTagWhitespace": false,
"sortAttributes": true,
"sortClassName": true,
"trimCustomFragments": true,
"useShortDoctype": true
}
accessibility-check: 0
add-meta-charset: no
add-xml-decl: no
add-xml-space: no
alt-text:
anchor-as-name: yes
ascii-chars: no
assume-xml-procins: no
bare: no
break-before-br: no
char-encoding: utf8
clean: no
coerce-endtags: yes
css-prefix: c
custom-tags: no
decorate-inferred-ul: no
doctype: auto
drop-empty-elements: yes
drop-empty-paras: yes
drop-proprietary-attributes: no
enclose-block-text: no
enclose-text: no
error-file:
escape-cdata: no
escape-scripts: yes
fix-backslash: yes
fix-bad-comments: auto
fix-style-tags: yes
fix-uri: yes
force-output: no
gdoc: no
gnu-emacs: no
hide-comments: no
indent: auto
indent-attributes: no
indent-cdata: no
indent-spaces: 4
indent-with-tabs: no
input-encoding: utf8
input-xml: no
join-classes: no
join-styles: yes
keep-tabs: no
keep-time: no
literal-attributes: no
logical-emphasis: no
lower-literals: yes
markup: yes
merge-divs: auto
merge-emphasis: yes
merge-spans: auto
mute:
mute-id: no
ncr: yes
new-blocklevel-tags:
new-empty-tags:
new-inline-tags:
new-pre-tags:
newline: LF
numeric-entities: no
omit-optional-tags: no
output-bom: auto
output-encoding: utf8
output-file:
output-html: no
output-xhtml: no
output-xml: no
preserve-entities: no
priority-attributes:
punctuation-wrap: no
quiet: no
quote-ampersand: yes
quote-marks: no
quote-nbsp: yes
repeated-attributes: keep-last
replace-color: no
show-body-only: no
show-errors: 6
show-info: yes
show-meta-change: no
show-warnings: yes
skip-nested: yes
sort-attributes: none
strict-tags-attributes: no
tab-size: 8
tidy-mark: yes
uppercase-attributes: no
uppercase-tags: no
vertical-space: no
warn-proprietary-attributes: yes
word-2000: no
wrap: 120
wrap-asp: yes
wrap-attributes: no
wrap-jste: yes
wrap-php: yes
wrap-script-literals: no
wrap-sections: yes
write-back: no
accessibility-check: 0
add-meta-charset: no
add-xml-decl: no
add-xml-space: no
alt-text:
anchor-as-name: yes
ascii-chars: no
assume-xml-procins: no
bare: no
break-before-br: no
char-encoding: utf8
clean: no
coerce-endtags: yes
css-prefix: c
custom-tags: no
decorate-inferred-ul: no
doctype: auto
drop-empty-elements: yes
drop-empty-paras: yes
drop-proprietary-attributes: no
enclose-block-text: no
enclose-text: no
error-file:
escape-cdata: no
escape-scripts: yes
fix-backslash: yes
fix-bad-comments: auto
fix-style-tags: yes
fix-uri: yes
force-output: no
gdoc: no
gnu-emacs: no
hide-comments: no
indent: auto
indent-attributes: no
indent-cdata: no
indent-spaces: 4
indent-with-tabs: no
input-encoding: utf8
input-xml: yes
join-classes: no
join-styles: yes
keep-tabs: no
keep-time: no
literal-attributes: no
logical-emphasis: no
lower-literals: yes
markup: yes
merge-divs: auto
merge-emphasis: yes
merge-spans: auto
mute:
mute-id: no
ncr: yes
new-blocklevel-tags:
new-empty-tags:
new-inline-tags:
new-pre-tags:
newline: LF
numeric-entities: no
omit-optional-tags: no
output-bom: auto
output-encoding: utf8
output-file:
output-html: no
output-xhtml: no
output-xml: no
preserve-entities: no
priority-attributes:
punctuation-wrap: no
quiet: no
quote-ampersand: yes
quote-marks: no
quote-nbsp: yes
repeated-attributes: keep-last
replace-color: no
show-body-only: no
show-errors: 6
show-info: yes
show-meta-change: no
show-warnings: yes
skip-nested: yes
sort-attributes: none
strict-tags-attributes: no
tab-size: 8
tidy-mark: yes
uppercase-attributes: no
uppercase-tags: no
vertical-space: no
warn-proprietary-attributes: yes
word-2000: no
wrap: 120
wrap-asp: yes
wrap-attributes: no
wrap-jste: yes
wrap-php: yes
wrap-script-literals: no
wrap-sections: yes
write-back: no
{
"indent_size": 4,
"indent_char": " ",
"indent_with_tabs": false,
"editorconfig": false,
"eol": "\n",
"end_with_newline": true,
"indent_level": 0,
"preserve_newlines": false,
"max_preserve_newlines": 5,
"space_in_paren": false,
"space_in_empty_paren": false,
"jslint_happy": false,
"space_after_anon_function": false,
"space_after_named_function": false,
"brace_style": "collapse",
"unindent_chained_methods": false,
"break_chained_methods": false,
"keep_array_indentation": false,
"unescape_strings": false,
"wrap_line_length": 0,
"e4x": false,
"comma_first": false,
"operator_position": "before-newline",
"css": {
"selector_separator_newline": true,
"newline_between_rules": true,
"space_around_combinator": true
},
"html": {
"indent_inner_html": false,
"indent_head_inner_html": true,
"indent_body_inner_html": true
}
}
{
"indent": 4,
"sort_keys": false,
"separators": [",", ": "]
}
# Perl Best Practices (PBP)
-l=78 # Max line width is 78 cols
-i=4 # Indent level is 4 cols
-ci=4 # Continuation indent is 4 cols
-vt=2 # Maximal vertical tightness
-cti=0 # No extra indentation for closing brackets
-pt=1 # Medium parenthesis tightness
-bt=1 # Medium brace tightness
-sbt=1 # Medium square bracket tightness
-bbt=1 # Medium block brace tightness
-nsfs # No space before semicolons
-nolq # Don't outdent long quoted strings
# Break before all operators
-wbb="% + - * / x != == >= <= =~ !~ < > | & = **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x="
<?php
/*
* This document has been generated with
* https://mlocati.github.io/php-cs-fixer-configurator/?version=2.13#configurator
* you can change this configuration by importing this file.
*/
return PhpCsFixer\Config::create()
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'@Symfony' => true,
'align_multiline_comment' => ['comment_type' => 'all_multiline'],
'array_syntax' => ['syntax' => 'short'],
'blank_line_before_statement' => ['statements' => ['declare', 'return']],
'cast_spaces' => ['space' => 'none'],
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
'concat_space' => ['spacing' => 'one'],
'declare_equal_normalize' => ['space' => 'single'],
'doctrine_annotation_array_assignment' => true,
'doctrine_annotation_braces' => ['syntax' => 'with_braces'],
'doctrine_annotation_indentation' => ['indent_mixed_lines' => true],
'doctrine_annotation_spaces' => true,
'hash_to_slash_comment' => true,
'heredoc_to_nowdoc' => true,
'increment_style' => ['style' => 'post'],
'linebreak_after_opening_tag' => true,
'list_syntax' => true,
'modernize_types_casting' => true,
'no_extra_consecutive_blank_lines' => ['tokens' => ['extra', 'break', 'continue', 'curly_brace_block', 'parenthesis_brace_block', 'return']],
'no_multiline_whitespace_before_semicolons' => true,
'no_short_echo_tag' => true,
'no_superfluous_elseif' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'php_unit_test_class_requires_covers' => true,
'phpdoc_add_missing_param_annotation' => ['only_untyped' => false],
'phpdoc_no_alias_tag' => false,
'phpdoc_no_empty_return' => false,
'phpdoc_order' => true,
'phpdoc_types_order' => true,
'phpdoc_var_without_name' => false,
'random_api_migration' => true,
'return_type_declaration' => ['space_before' => 'one'],
'single_line_comment_style' => ['comment_types' => ['hash']],
'space_after_semicolon' => ['remove_in_empty_for_expressions' => true],
'strict_comparison' => true,
'trailing_comma_in_multiline_array' => false,
'yoda_style' => false,
])
->setFinder(PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__)
)
;
/* YAML
* Backup 2019.01.06
version: 2.13.1
fixerSets:
- '@PSR2'
- '@Symfony'
fixers:
align_multiline_comment:
comment_type: all_multiline
array_syntax:
syntax: short
blank_line_before_statement:
statements:
- declare
- return
cast_spaces:
space: none
combine_consecutive_issets: true
combine_consecutive_unsets: true
compact_nullable_typehint: true
concat_space:
spacing: one
declare_equal_normalize:
space: single
doctrine_annotation_array_assignment: true
doctrine_annotation_braces:
syntax: with_braces
doctrine_annotation_indentation:
indent_mixed_lines: true
doctrine_annotation_spaces: true
hash_to_slash_comment: true
heredoc_to_nowdoc: true
increment_style:
style: post
linebreak_after_opening_tag: true
list_syntax: true
modernize_types_casting: true
no_extra_consecutive_blank_lines:
tokens:
- extra
- break
- continue
- curly_brace_block
- parenthesis_brace_block
- return
no_multiline_whitespace_before_semicolons: true
no_short_echo_tag: true
no_superfluous_elseif: true
no_useless_else: true
no_useless_return: true
ordered_class_elements: true
ordered_imports: true
php_unit_test_class_requires_covers: true
phpdoc_add_missing_param_annotation:
only_untyped: false
phpdoc_no_alias_tag: false
phpdoc_no_empty_return: false
phpdoc_order: true
phpdoc_types_order: true
phpdoc_var_without_name: false
random_api_migration: true
return_type_declaration:
space_before: one
single_line_comment_style:
comment_types:
- hash
space_after_semicolon:
remove_in_empty_for_expressions: true
strict_comparison: true
trailing_comma_in_multiline_array: false
yoda_style: false
risky: true
*/
// {
// "bracketSpacing": true,
// "jsxSingleQuote": true,
// "printWidth": 120,
// "singleQuote": true,
// "tabWidth": 4
// }
{
"bracketSpacing": true,
"jsxSingleQuote": false,
"printWidth": 80,
"singleQuote": false,
"tabWidth": 2
}
# Common configuration.
AllCops:
RubyInterpreters:
- ruby
- macruby
- rake
- jruby
- rbx
# Include common Ruby source files.
Include:
- '**/*.rb'
- '**/*.arb'
- '**/*.axlsx'
- '**/*.builder'
- '**/*.fcgi'
- '**/*.gemfile'
- '**/*.gemspec'
- '**/*.god'
- '**/*.jb'
- '**/*.jbuilder'
- '**/*.mspec'
- '**/*.opal'
- '**/*.pluginspec'
- '**/*.podspec'
- '**/*.rabl'
- '**/*.rake'
- '**/*.rbuild'
- '**/*.rbw'
- '**/*.rbx'
- '**/*.ru'
- '**/*.ruby'
- '**/*.spec'
- '**/*.thor'
- '**/*.watchr'
- '**/.irbrc'
- '**/.pryrc'
- '**/buildfile'
- '**/Appraisals'
- '**/Berksfile'
- '**/Brewfile'
- '**/Buildfile'
- '**/Capfile'
- '**/Cheffile'
- '**/Dangerfile'
- '**/Deliverfile'
- '**/Fastfile'
- '**/*Fastfile'
- '**/Gemfile'
- '**/Guardfile'
- '**/Jarfile'
- '**/Mavenfile'
- '**/Podfile'
- '**/Puppetfile'
- '**/Rakefile'
- '**/Snapfile'
- '**/Thorfile'
- '**/Vagabondfile'
- '**/Vagrantfile'
Exclude:
- 'node_modules/**/*'
- 'vendor/**/*'
- '.git/**/*'
# Default formatter will be used if no `-f/--format` option is given.
DefaultFormatter: progress
# Cop names are displayed in offense messages by default. Change behavior
# by overriding DisplayCopNames, or by giving the `--no-display-cop-names`
# option.
DisplayCopNames: true
# Style guide URLs are not displayed in offense messages by default. Change
# behavior by overriding `DisplayStyleGuide`, or by giving the
# `-S/--display-style-guide` option.
DisplayStyleGuide: false
# When specifying style guide URLs, any paths and/or fragments will be
# evaluated relative to the base URL.
StyleGuideBaseURL: https://github.com/rubocop-hq/ruby-style-guide
# Extra details are not displayed in offense messages by default. Change
# behavior by overriding ExtraDetails, or by giving the
# `-E/--extra-details` option.
ExtraDetails: false
# Additional cops that do not reference a style guide rule may be enabled by
# default. Change behavior by overriding `StyleGuideCopsOnly`, or by giving
# the `--only-guide-cops` option.
StyleGuideCopsOnly: false
# All cops except the ones configured `Enabled: false` in this file are enabled by default.
# Change this behavior by overriding either `DisabledByDefault` or `EnabledByDefault`.
# When `DisabledByDefault` is `true`, all cops in the default configuration
# are disabled, and only cops in user configuration are enabled. This makes
# cops opt-in instead of opt-out. Note that when `DisabledByDefault` is `true`,
# cops in user configuration will be enabled even if they don't set the
# Enabled parameter.
# When `EnabledByDefault` is `true`, all cops, even those configured `Enabled: false`
# in this file are enabled by default. Cops can still be disabled in user configuration.
# Note that it is invalid to set both EnabledByDefault and DisabledByDefault
# to true in the same configuration.
EnabledByDefault: false
DisabledByDefault: false
# Enables the result cache if `true`. Can be overridden by the `--cache` command
# line option.
UseCache: true
# Threshold for how many files can be stored in the result cache before some
# of the files are automatically removed.
MaxFilesInCache: 20000
# The cache will be stored in "rubocop_cache" under this directory. If
# CacheRootDirectory is ~ (nil), which it is by default, the root will be
# taken from the environment variable `$XDG_CACHE_HOME` if it is set, or if
# `$XDG_CACHE_HOME` is not set, it will be `$HOME/.cache/`.
CacheRootDirectory: ~
# It is possible for a malicious user to know the location of RuboCop's cache
# directory by looking at CacheRootDirectory, and create a symlink in its
# place that could cause RuboCop to overwrite unintended files, or read
# malicious input. If you are certain that your cache location is secure from
# this kind of attack, and wish to use a symlinked cache location, set this
# value to "true".
AllowSymlinksInCacheRootDirectory: false
# What MRI version of the Ruby interpreter is the inspected code intended to
# run on? (If there is more than one, set this to the lowest version.)
# If a value is specified for TargetRubyVersion then it is used. Acceptable
# values are specificed as a float (i.e. 2.5); the teeny version of Ruby
# should not be included. If the project specifies a Ruby version in the
# .ruby-version file, Gemfile or gems.rb file, RuboCop will try to determine
# the desired version of Ruby by inspecting the .ruby-version file first,
# followed by the Gemfile.lock or gems.locked file. (Although the Ruby version
# is specified in the Gemfile or gems.rb file, RuboCop reads the final value
# from the lock file.) If the Ruby version is still unresolved, RuboCop will
# use the oldest officially supported Ruby version (currently Ruby 2.2).
TargetRubyVersion: ~
# What version of Rails is the inspected code using? If a value is specified
# for TargetRailsVersion then it is used. Acceptable values are specificed
# as a float (i.e. 5.1); the patch version of Rails should not be included.
# If TargetRailsVersion is not set, RuboCop will parse the Gemfile.lock or
# gems.locked file to find the version of Rails that has been bound to the
# application. If neither of those files exist, RuboCop will use Rails 5.0
# as the default.
TargetRailsVersion: ~
#################### Bundler ###############################
Bundler/DuplicatedGem:
Description: 'Checks for duplicate gem entries in Gemfile.'
Enabled: true
VersionAdded: '0.46'
Include:
- '**/*.gemfile'
- '**/Gemfile'
- '**/gems.rb'
Bundler/GemComment:
Description: 'Add a comment describing each gem.'
Enabled: false
VersionAdded: '0.59'
Include:
- '**/*.gemfile'
- '**/Gemfile'
- '**/gems.rb'
Whitelist: []
Bundler/InsecureProtocolSource:
Description: >-
The source `:gemcutter`, `:rubygems` and `:rubyforge` are deprecated
because HTTP requests are insecure. Please change your source to
'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
Enabled: true
VersionAdded: '0.50'
Include:
- '**/*.gemfile'
- '**/Gemfile'
- '**/gems.rb'
Bundler/OrderedGems:
Description: >-
Gems within groups in the Gemfile should be alphabetically sorted.
Enabled: true
VersionAdded: '0.46'
VersionChanged: '0.47'
TreatCommentsAsGroupSeparators: true
Include:
- '**/*.gemfile'
- '**/Gemfile'
- '**/gems.rb'
#################### Gemspec ###############################
Gemspec/DuplicatedAssignment:
Description: 'An attribute assignment method calls should be listed only once in a gemspec.'
Enabled: true
VersionAdded: '0.52'
Include:
- '**/*.gemspec'
Gemspec/OrderedDependencies:
Description: >-
Dependencies in the gemspec should be alphabetically sorted.
Enabled: true
VersionAdded: '0.51'
TreatCommentsAsGroupSeparators: true
Include:
- '**/*.gemspec'
Gemspec/RequiredRubyVersion:
Description: 'Checks that `required_ruby_version` of gemspec and `TargetRubyVersion` of .rubocop.yml are equal.'
Enabled: true
VersionAdded: '0.52'
Include:
- '**/*.gemspec'
#################### Layout ###########################
Layout/AccessModifierIndentation:
Description: Check indentation of private/protected visibility modifiers.
StyleGuide: '#indent-public-private-protected'
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: indent
SupportedStyles:
- outdent
- indent
# By default, the indentation width from Layout/IndentationWidth is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
Layout/AlignArray:
Description: >-
Align the elements of an array literal if they span more than
one line.
StyleGuide: '#align-multiline-arrays'
Enabled: true
VersionAdded: '0.49'
Layout/AlignHash:
Description: >-
Align the elements of a hash literal if they span more than
one line.
Enabled: true
VersionAdded: '0.49'
# Alignment of entries using hash rocket as separator. Valid values are:
#
# key - left alignment of keys
# 'a' => 2
# 'bb' => 3
# separator - alignment of hash rockets, keys are right aligned
# 'a' => 2
# 'bb' => 3
# table - left alignment of keys, hash rockets, and values
# 'a' => 2
# 'bb' => 3
EnforcedHashRocketStyle: key
SupportedHashRocketStyles:
- key
- separator
- table
# Alignment of entries using colon as separator. Valid values are:
#
# key - left alignment of keys
# a: 0
# bb: 1
# separator - alignment of colons, keys are right aligned
# a: 0
# bb: 1
# table - left alignment of keys and values
# a: 0
# bb: 1
EnforcedColonStyle: key
SupportedColonStyles:
- key
- separator
- table
# Select whether hashes that are the last argument in a method call should be
# inspected? Valid values are:
#
# always_inspect - Inspect both implicit and explicit hashes.
# Registers an offense for:
# function(a: 1,
# b: 2)
# Registers an offense for:
# function({a: 1,
# b: 2})
# always_ignore - Ignore both implicit and explicit hashes.
# Accepts:
# function(a: 1,
# b: 2)
# Accepts:
# function({a: 1,
# b: 2})
# ignore_implicit - Ignore only implicit hashes.
# Accepts:
# function(a: 1,
# b: 2)
# Registers an offense for:
# function({a: 1,
# b: 2})
# ignore_explicit - Ignore only explicit hashes.
# Accepts:
# function({a: 1,
# b: 2})
# Registers an offense for:
# function(a: 1,
# b: 2)
EnforcedLastArgumentHashStyle: always_inspect
SupportedLastArgumentHashStyles:
- always_inspect
- always_ignore
- ignore_implicit
- ignore_explicit
Layout/AlignParameters:
Description: >-
Align the parameters of a method call if they span more
than one line.
StyleGuide: '#no-double-indent'
Enabled: true
VersionAdded: '0.49'
# Alignment of parameters in multi-line method calls.
#
# The `with_first_parameter` style aligns the following lines along the same
# column as the first parameter.
#
# method_call(a,
# b)
#
# The `with_fixed_indentation` style aligns the following lines with one
# level of indentation relative to the start of the line with the method call.
#
# method_call(a,
# b)
EnforcedStyle: with_first_parameter
SupportedStyles:
- with_first_parameter
- with_fixed_indentation
# By default, the indentation width from Layout/IndentationWidth is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
Layout/BlockAlignment:
Description: 'Align block ends correctly.'
Enabled: true
VersionAdded: '0.53'
# The value `start_of_block` means that the `end` should be aligned with line
# where the `do` keyword appears.
# The value `start_of_line` means it should be aligned with the whole
# expression's starting line.
# The value `either` means both are allowed.
EnforcedStyleAlignWith: either
SupportedStylesAlignWith:
- either
- start_of_block
- start_of_line
Layout/BlockEndNewline:
Description: 'Put end statement of multiline block on its own line.'
Enabled: true
VersionAdded: '0.49'
Layout/CaseIndentation:
Description: 'Indentation of when in a case/when/[else/]end.'
StyleGuide: '#indent-when-to-case'
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: case
SupportedStyles:
- case
- end
IndentOneStep: false
# By default, the indentation width from `Layout/IndentationWidth` is used.
# But it can be overridden by setting this parameter.
# This only matters if `IndentOneStep` is `true`
IndentationWidth: ~
Layout/ClassStructure:
Description: 'Enforces a configured order of definitions within a class body.'
StyleGuide: 'https://github.com/rubocop-hq/ruby-style-guide#consistent-classes'
Enabled: false
VersionAdded: '0.52'
Categories:
module_inclusion:
- include
- prepend
- extend
ExpectedOrder:
- module_inclusion
- constants
- public_class_methods
- initializer
- public_methods
- protected_methods
- private_methods
Layout/ClosingHeredocIndentation:
Description: 'Checks the indentation of here document closings.'
Enabled: true
VersionAdded: '0.57'
Layout/ClosingParenthesisIndentation:
Description: 'Checks the indentation of hanging closing parentheses.'
Enabled: true
VersionAdded: '0.49'
Layout/CommentIndentation:
Description: 'Indentation of comments.'
Enabled: true
VersionAdded: '0.49'
Layout/ConditionPosition:
Description: >-
Checks for condition placed in a confusing position relative to
the keyword.
StyleGuide: '#same-line-condition'
Enabled: true
VersionAdded: '0.53'
Layout/DefEndAlignment:
Description: 'Align ends corresponding to defs correctly.'
Enabled: true
VersionAdded: '0.53'
# The value `def` means that `end` should be aligned with the def keyword.
# The value `start_of_line` means that `end` should be aligned with method
# calls like `private`, `public`, etc, if present in front of the `def`
# keyword on the same line.
EnforcedStyleAlignWith: start_of_line
SupportedStylesAlignWith:
- start_of_line
- def
AutoCorrect: false
Severity: warning
Layout/DotPosition:
Description: 'Checks the position of the dot in multi-line method calls.'
StyleGuide: '#consistent-multi-line-chains'
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: leading
SupportedStyles:
- leading
- trailing
Layout/ElseAlignment:
Description: 'Align elses and elsifs correctly.'
Enabled: true
VersionAdded: '0.49'
Layout/EmptyComment:
Description: 'Checks empty comment.'
Enabled: true
VersionAdded: '0.53'
AllowBorderComment: true
AllowMarginComment: true
Layout/EmptyLineAfterGuardClause:
Description: 'Add empty line after guard clause.'
Enabled: true
VersionAdded: '0.56'
VersionChanged: '0.59'
Layout/EmptyLineAfterMagicComment:
Description: 'Add an empty line after magic comments to separate them from code.'
StyleGuide: '#separate-magic-comments-from-code'
Enabled: true
VersionAdded: '0.49'
Layout/EmptyLineBetweenDefs:
Description: 'Use empty lines between defs.'
StyleGuide: '#empty-lines-between-methods'
Enabled: true
VersionAdded: '0.49'
# If `true`, this parameter means that single line method definitions don't
# need an empty line between them.
AllowAdjacentOneLineDefs: false
# Can be array to specify minimum and maximum number of empty lines, e.g. [1, 2]
NumberOfEmptyLines: 1
Layout/EmptyLines:
Description: "Don't use several empty lines in a row."
StyleGuide: '#two-or-more-empty-lines'
Enabled: true
VersionAdded: '0.49'
Layout/EmptyLinesAroundAccessModifier:
Description: "Keep blank lines around access modifiers."
StyleGuide: '#empty-lines-around-access-modifier'
Enabled: true
VersionAdded: '0.49'
Layout/EmptyLinesAroundArguments:
Description: "Keeps track of empty lines around method arguments."
Enabled: true
VersionAdded: '0.52'
Layout/EmptyLinesAroundBeginBody:
Description: "Keeps track of empty lines around begin-end bodies."
StyleGuide: '#empty-lines-around-bodies'
Enabled: true
VersionAdded: '0.49'
Layout/EmptyLinesAroundBlockBody:
Description: "Keeps track of empty lines around block bodies."
StyleGuide: '#empty-lines-around-bodies'
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: no_empty_lines
SupportedStyles:
- empty_lines
- no_empty_lines
Layout/EmptyLinesAroundClassBody:
Description: "Keeps track of empty lines around class bodies."
StyleGuide: '#empty-lines-around-bodies'
Enabled: true
VersionAdded: '0.49'
VersionChanged: '0.53'
EnforcedStyle: no_empty_lines
SupportedStyles:
- empty_lines
- empty_lines_except_namespace
- empty_lines_special
- no_empty_lines
- beginning_only
- ending_only
Layout/EmptyLinesAroundExceptionHandlingKeywords:
Description: "Keeps track of empty lines around exception handling keywords."
StyleGuide: '#empty-lines-around-bodies'
Enabled: true
VersionAdded: '0.49'
Layout/EmptyLinesAroundMethodBody:
Description: "Keeps track of empty lines around method bodies."
StyleGuide: '#empty-lines-around-bodies'
Enabled: true
VersionAdded: '0.49'
Layout/EmptyLinesAroundModuleBody:
Description: "Keeps track of empty lines around module bodies."
StyleGuide: '#empty-lines-around-bodies'
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: no_empty_lines
SupportedStyles:
- empty_lines
- empty_lines_except_namespace
- empty_lines_special
- no_empty_lines
Layout/EndAlignment:
Description: 'Align ends correctly.'
Enabled: true
VersionAdded: '0.53'
# The value `keyword` means that `end` should be aligned with the matching
# keyword (`if`, `while`, etc.).
# The value `variable` means that in assignments, `end` should be aligned
# with the start of the variable on the left hand side of `=`. In all other
# situations, `end` should still be aligned with the keyword.
# The value `start_of_line` means that `end` should be aligned with the start
# of the line which the matching keyword appears on.
EnforcedStyleAlignWith: keyword
SupportedStylesAlignWith:
- keyword
- variable
- start_of_line
AutoCorrect: false
Severity: warning
Layout/EndOfLine:
Description: 'Use Unix-style line endings.'
StyleGuide: '#crlf'
Enabled: true
VersionAdded: '0.49'
# The `native` style means that CR+LF (Carriage Return + Line Feed) is
# enforced on Windows, and LF is enforced on other platforms. The other styles
# mean LF and CR+LF, respectively.
EnforcedStyle: native
SupportedStyles:
- native
- lf
- crlf
Layout/ExtraSpacing:
Description: 'Do not use unnecessary spacing.'
Enabled: true
VersionAdded: '0.49'
# When true, allows most uses of extra spacing if the intent is to align
# things with the previous or next line, not counting empty lines or comment
# lines.
AllowForAlignment: true
# When true, forces the alignment of `=` in assignments on consecutive lines.
ForceEqualSignAlignment: false
Layout/FirstArrayElementLineBreak:
Description: >-
Checks for a line break before the first element in a
multi-line array.
Enabled: false
VersionAdded: '0.49'
Layout/FirstHashElementLineBreak:
Description: >-
Checks for a line break before the first element in a
multi-line hash.
Enabled: false
VersionAdded: '0.49'
Layout/FirstMethodArgumentLineBreak:
Description: >-
Checks for a line break before the first argument in a
multi-line method call.
Enabled: false
VersionAdded: '0.49'
Layout/FirstMethodParameterLineBreak:
Description: >-
Checks for a line break before the first parameter in a
multi-line method parameter definition.
Enabled: false
VersionAdded: '0.49'
Layout/FirstParameterIndentation:
Description: 'Checks the indentation of the first parameter in a method call.'
Enabled: true
VersionAdded: '0.49'
VersionChanged: '0.56'
EnforcedStyle: special_for_inner_method_call_in_parentheses
SupportedStyles:
# The first parameter should always be indented one step more than the
# preceding line.
- consistent
# The first parameter should always be indented one level relative to the
# parent that is receiving the parameter
- consistent_relative_to_receiver
# The first parameter should normally be indented one step more than the
# preceding line, but if it's a parameter for a method call that is itself
# a parameter in a method call, then the inner parameter should be indented
# relative to the inner method.
- special_for_inner_method_call
# Same as `special_for_inner_method_call` except that the special rule only
# applies if the outer method call encloses its arguments in parentheses.
- special_for_inner_method_call_in_parentheses
# By default, the indentation width from `Layout/IndentationWidth` is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
Layout/IndentArray:
Description: >-
Checks the indentation of the first element in an array
literal.
Enabled: true
VersionAdded: '0.49'
# The value `special_inside_parentheses` means that array literals with
# brackets that have their opening bracket on the same line as a surrounding
# opening round parenthesis, shall have their first element indented relative
# to the first position inside the parenthesis.
#
# The value `consistent` means that the indentation of the first element shall
# always be relative to the first position of the line where the opening
# bracket is.
#
# The value `align_brackets` means that the indentation of the first element
# shall always be relative to the position of the opening bracket.
EnforcedStyle: special_inside_parentheses
SupportedStyles:
- special_inside_parentheses
- consistent
- align_brackets
# By default, the indentation width from `Layout/IndentationWidth` is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
Layout/IndentAssignment:
Description: >-
Checks the indentation of the first line of the
right-hand-side of a multi-line assignment.
Enabled: true
VersionAdded: '0.49'
# By default, the indentation width from `Layout/IndentationWidth` is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
Layout/IndentHash:
Description: 'Checks the indentation of the first key in a hash literal.'
Enabled: true
VersionAdded: '0.49'
# The value `special_inside_parentheses` means that hash literals with braces
# that have their opening brace on the same line as a surrounding opening
# round parenthesis, shall have their first key indented relative to the
# first position inside the parenthesis.
#
# The value `consistent` means that the indentation of the first key shall
# always be relative to the first position of the line where the opening
# brace is.
#
# The value `align_braces` means that the indentation of the first key shall
# always be relative to the position of the opening brace.
EnforcedStyle: special_inside_parentheses
SupportedStyles:
- special_inside_parentheses
- consistent
- align_braces
# By default, the indentation width from `Layout/IndentationWidth` is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
Layout/IndentHeredoc:
Description: 'This cop checks the indentation of the here document bodies.'
StyleGuide: '#squiggly-heredocs'
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: auto_detection
SupportedStyles:
- auto_detection
- squiggly
- active_support
- powerpack
- unindent
Layout/IndentationConsistency:
Description: 'Keep indentation straight.'
StyleGuide: '#spaces-indentation'
Enabled: true
VersionAdded: '0.49'
# The difference between `rails` and `normal` is that the `rails` style
# prescribes that in classes and modules the `protected` and `private`
# modifier keywords shall be indented the same as public methods and that
# protected and private members shall be indented one step more than the
# modifiers. Other than that, both styles mean that entities on the same
# logical depth shall have the same indentation.
EnforcedStyle: normal
SupportedStyles:
- normal
- rails
Layout/IndentationWidth:
Description: 'Use 2 spaces for indentation.'
StyleGuide: '#spaces-indentation'
Enabled: true
VersionAdded: '0.49'
# Number of spaces for each indentation level.
Width: 2
IgnoredPatterns: []
Layout/InitialIndentation:
Description: >-
Checks the indentation of the first non-blank non-comment line in a file.
Enabled: true
VersionAdded: '0.49'
Layout/LeadingBlankLines:
Description: Check for unnecessary blank lines at the beginning of a file.
Enabled: true
VersionAdded: '0.57'
Layout/LeadingCommentSpace:
Description: 'Comments should start with a space.'
StyleGuide: '#hash-space'
Enabled: true
VersionAdded: '0.49'
Layout/MultilineArrayBraceLayout:
Description: >-
Checks that the closing brace in an array literal is
either on the same line as the last array element, or
a new line.
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: symmetrical
SupportedStyles:
# symmetrical: closing brace is positioned in same way as opening brace
# new_line: closing brace is always on a new line
# same_line: closing brace is always on the same line as last element
- symmetrical
- new_line
- same_line
Layout/MultilineAssignmentLayout:
Description: 'Check for a newline after the assignment operator in multi-line assignments.'
StyleGuide: '#indent-conditional-assignment'
Enabled: false
VersionAdded: '0.49'
# The types of assignments which are subject to this rule.
SupportedTypes:
- block
- case
- class
- if
- kwbegin
- module
EnforcedStyle: new_line
SupportedStyles:
# Ensures that the assignment operator and the rhs are on the same line for
# the set of supported types.
- same_line
# Ensures that the assignment operator and the rhs are on separate lines
# for the set of supported types.
- new_line
Layout/MultilineBlockLayout:
Description: 'Ensures newlines after multiline block do statements.'
Enabled: true
VersionAdded: '0.49'
Layout/MultilineHashBraceLayout:
Description: >-
Checks that the closing brace in a hash literal is
either on the same line as the last hash element, or
a new line.
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: symmetrical
SupportedStyles:
# symmetrical: closing brace is positioned in same way as opening brace
# new_line: closing brace is always on a new line
# same_line: closing brace is always on same line as last element
- symmetrical
- new_line
- same_line
Layout/MultilineMethodCallBraceLayout:
Description: >-
Checks that the closing brace in a method call is
either on the same line as the last method argument, or
a new line.
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: symmetrical
SupportedStyles:
# symmetrical: closing brace is positioned in same way as opening brace
# new_line: closing brace is always on a new line
# same_line: closing brace is always on the same line as last argument
- symmetrical
- new_line
- same_line
Layout/MultilineMethodCallIndentation:
Description: >-
Checks indentation of method calls with the dot operator
that span more than one line.
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: aligned
SupportedStyles:
- aligned
- indented
- indented_relative_to_receiver
# By default, the indentation width from Layout/IndentationWidth is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
Layout/MultilineMethodDefinitionBraceLayout:
Description: >-
Checks that the closing brace in a method definition is
either on the same line as the last method parameter, or
a new line.
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: symmetrical
SupportedStyles:
# symmetrical: closing brace is positioned in same way as opening brace
# new_line: closing brace is always on a new line
# same_line: closing brace is always on the same line as last parameter
- symmetrical
- new_line
- same_line
Layout/MultilineOperationIndentation:
Description: >-
Checks indentation of binary operations that span more than
one line.
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: aligned
SupportedStyles:
- aligned
- indented
# By default, the indentation width from `Layout/IndentationWidth` is used
# But it can be overridden by setting this parameter
IndentationWidth: ~
Layout/RescueEnsureAlignment:
Description: 'Align rescues and ensures correctly.'
Enabled: true
VersionAdded: '0.49'
Layout/SpaceAfterColon:
Description: 'Use spaces after colons.'
StyleGuide: '#spaces-operators'
Enabled: true
VersionAdded: '0.49'
Layout/SpaceAfterComma:
Description: 'Use spaces after commas.'
StyleGuide: '#spaces-operators'
Enabled: true
VersionAdded: '0.49'
Layout/SpaceAfterMethodName:
Description: >-
Do not put a space between a method name and the opening
parenthesis in a method definition.
StyleGuide: '#parens-no-spaces'
Enabled: true
VersionAdded: '0.49'
Layout/SpaceAfterNot:
Description: Tracks redundant space after the ! operator.
StyleGuide: '#no-space-bang'
Enabled: true
VersionAdded: '0.49'
Layout/SpaceAfterSemicolon:
Description: 'Use spaces after semicolons.'
StyleGuide: '#spaces-operators'
Enabled: true
VersionAdded: '0.49'
Layout/SpaceAroundBlockParameters:
Description: 'Checks the spacing inside and after block parameters pipes.'
Enabled: true
VersionAdded: '0.49'
EnforcedStyleInsidePipes: no_space
SupportedStylesInsidePipes:
- space
- no_space
Layout/SpaceAroundEqualsInParameterDefault:
Description: >-
Checks that the equals signs in parameter default assignments
have or don't have surrounding space depending on
configuration.
StyleGuide: '#spaces-around-equals'
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: space
SupportedStyles:
- space
- no_space
Layout/SpaceAroundKeyword:
Description: 'Use a space around keywords if appropriate.'
Enabled: true
VersionAdded: '0.49'
Layout/SpaceAroundOperators:
Description: 'Use a single space around operators.'
StyleGuide: '#spaces-operators'
Enabled: true
VersionAdded: '0.49'
# When `true`, allows most uses of extra spacing if the intent is to align
# with an operator on the previous or next line, not counting empty lines
# or comment lines.
AllowForAlignment: true
Layout/SpaceBeforeBlockBraces:
Description: >-
Checks that the left block brace has or doesn't have space
before it.
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: space
SupportedStyles:
- space
- no_space
EnforcedStyleForEmptyBraces: space
SupportedStylesForEmptyBraces:
- space
- no_space
VersionChanged: '0.52.1'
Layout/SpaceBeforeComma:
Description: 'No spaces before commas.'
Enabled: true
VersionAdded: '0.49'
Layout/SpaceBeforeComment:
Description: >-
Checks for missing space between code and a comment on the
same line.
Enabled: true
VersionAdded: '0.49'
Layout/SpaceBeforeFirstArg:
Description: >-
Checks that exactly one space is used between a method name
and the first argument for method calls without parentheses.
Enabled: true
VersionAdded: '0.49'
# When `true`, allows most uses of extra spacing if the intent is to align
# things with the previous or next line, not counting empty lines or comment
# lines.
AllowForAlignment: true
Layout/SpaceBeforeSemicolon:
Description: 'No spaces before semicolons.'
Enabled: true
VersionAdded: '0.49'
Layout/SpaceInLambdaLiteral:
Description: 'Checks for spaces in lambda literals.'
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: require_no_space
SupportedStyles:
- require_no_space
- require_space
Layout/SpaceInsideArrayLiteralBrackets:
Description: 'Checks the spacing inside array literal brackets.'
Enabled: true
VersionAdded: '0.52'
EnforcedStyle: no_space
SupportedStyles:
- space
- no_space
# 'compact' normally requires a space inside the brackets, with the exception
# that successive left brackets or right brackets are collapsed together
- compact
EnforcedStyleForEmptyBrackets: no_space
SupportedStylesForEmptyBrackets:
- space
- no_space
Layout/SpaceInsideArrayPercentLiteral:
Description: 'No unnecessary additional spaces between elements in %i/%w literals.'
Enabled: true
VersionAdded: '0.49'
Layout/SpaceInsideBlockBraces:
Description: >-
Checks that block braces have or don't have surrounding space.
For blocks taking parameters, checks that the left brace has
or doesn't have trailing space.
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: space
SupportedStyles:
- space
- no_space
EnforcedStyleForEmptyBraces: no_space
SupportedStylesForEmptyBraces:
- space
- no_space
# Space between `{` and `|`. Overrides `EnforcedStyle` if there is a conflict.
SpaceBeforeBlockParameters: true
Layout/SpaceInsideHashLiteralBraces:
Description: "Use spaces inside hash literal braces - or don't."
StyleGuide: '#spaces-operators'
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: space
SupportedStyles:
- space
- no_space
# 'compact' normally requires a space inside hash braces, with the exception
# that successive left braces or right braces are collapsed together
- compact
EnforcedStyleForEmptyBraces: no_space
SupportedStylesForEmptyBraces:
- space
- no_space
Layout/SpaceInsideParens:
Description: 'No spaces after ( or before ).'
StyleGuide: '#spaces-braces'
Enabled: true
VersionAdded: '0.49'
VersionChanged: '0.55'
EnforcedStyle: no_space
SupportedStyles:
- space
- no_space
Layout/SpaceInsidePercentLiteralDelimiters:
Description: 'No unnecessary spaces inside delimiters of %i/%w/%x literals.'
Enabled: true
VersionAdded: '0.49'
Layout/SpaceInsideRangeLiteral:
Description: 'No spaces inside range literals.'
StyleGuide: '#no-space-inside-range-literals'
Enabled: true
VersionAdded: '0.49'
Layout/SpaceInsideReferenceBrackets:
Description: 'Checks the spacing inside referential brackets.'
Enabled: true
VersionAdded: '0.52'
VersionChanged: '0.53'
EnforcedStyle: no_space
SupportedStyles:
- space
- no_space
EnforcedStyleForEmptyBrackets: no_space
SupportedStylesForEmptyBrackets:
- space
- no_space
Layout/SpaceInsideStringInterpolation:
Description: 'Checks for padding/surrounding spaces inside string interpolation.'
StyleGuide: '#string-interpolation'
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: no_space
SupportedStyles:
- space
- no_space
Layout/Tab:
Description: 'No hard tabs.'
StyleGuide: '#spaces-indentation'
Enabled: true
VersionAdded: '0.49'
VersionChanged: '0.51'
# By default, the indentation width from Layout/IndentationWidth is used
# But it can be overridden by setting this parameter
# It is used during auto-correction to determine how many spaces should
# replace each tab.
IndentationWidth: ~
Layout/TrailingBlankLines:
Description: 'Checks trailing blank lines and final newline.'
StyleGuide: '#newline-eof'
Enabled: true
VersionAdded: '0.49'
EnforcedStyle: final_newline
SupportedStyles:
- final_newline
- final_blank_line
Layout/TrailingWhitespace:
Description: 'Avoid trailing whitespace.'
StyleGuide: '#no-trailing-whitespace'
Enabled: true
VersionAdded: '0.49'
VersionChanged: '0.55'
AllowInHeredoc: false
#################### Lint ##################################
### Warnings
Lint/AmbiguousBlockAssociation:
Description: >-
Checks for ambiguous block association with method when param passed without
parentheses.
StyleGuide: '#syntax'
Enabled: true
VersionAdded: '0.48'
Lint/AmbiguousOperator:
Description: >-
Checks for ambiguous operators in the first argument of a
method invocation without parentheses.
StyleGuide: '#method-invocation-parens'
Enabled: true
VersionAdded: '0.17'
Lint/AmbiguousRegexpLiteral:
Description: >-
Checks for ambiguous regexp literals in the first argument of
a method invocation without parentheses.
Enabled: true
VersionAdded: '0.17'
Lint/AssignmentInCondition:
Description: "Don't use assignment in conditions."
StyleGuide: '#safe-assignment-in-condition'
Enabled: true
VersionAdded: '0.9'
AllowSafeAssignment: true
Lint/BigDecimalNew:
Description: '`BigDecimal.new()` is deprecated. Use `BigDecimal()` instead.'
Enabled: true
VersionAdded: '0.53'
Lint/BooleanSymbol:
Description: 'Check for `:true` and `:false` symbols.'
Enabled: true
VersionAdded: '0.50'
Lint/CircularArgumentReference:
Description: "Default values in optional keyword arguments and optional ordinal arguments should not refer back to the name of the argument."
Enabled: true
VersionAdded: '0.33'
Lint/Debugger:
Description: 'Check for debugger calls.'
Enabled: true
VersionAdded: '0.14'
VersionChanged: '0.49'
Lint/DeprecatedClassMethods:
Description: 'Check for deprecated class method calls.'
Enabled: true
VersionAdded: '0.19'
Lint/DuplicateCaseCondition:
Description: 'Do not repeat values in case conditionals.'
Enabled: true
VersionAdded: '0.45'
Lint/DuplicateMethods:
Description: 'Check for duplicate method definitions.'
Enabled: true
VersionAdded: '0.29'
Lint/DuplicatedKey:
Description: 'Check for duplicate keys in hash literals.'
Enabled: true
VersionAdded: '0.34'
Lint/EachWithObjectArgument:
Description: 'Check for immutable argument given to each_with_object.'
Enabled: true
VersionAdded: '0.31'
Lint/ElseLayout:
Description: 'Check for odd code arrangement in an else block.'
Enabled: true
VersionAdded: '0.17'
Lint/EmptyEnsure:
Description: 'Checks for empty ensure block.'
Enabled: true
VersionAdded: '0.10'
VersionChanged: '0.48'
AutoCorrect: false
Lint/EmptyExpression:
Description: 'Checks for empty expressions.'
Enabled: true
VersionAdded: '0.45'
Lint/EmptyInterpolation:
Description: 'Checks for empty string interpolation.'
Enabled: true
VersionAdded: '0.20'
VersionChanged: '0.45'
Lint/EmptyWhen:
Description: 'Checks for `when` branches with empty bodies.'
Enabled: true
VersionAdded: '0.45'
Lint/EndInMethod:
Description: 'END blocks should not be placed inside method definitions.'
Enabled: true
VersionAdded: '0.9'
Lint/EnsureReturn:
Description: 'Do not use return in an ensure block.'
StyleGuide: '#no-return-ensure'
Enabled: true
VersionAdded: '0.9'
Lint/ErbNewArguments:
Description: 'Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`.'
Enabled: true
VersionAdded: '0.56'
Lint/FloatOutOfRange:
Description: >-
Catches floating-point literals too large or small for Ruby to
represent.
Enabled: true
VersionAdded: '0.36'
Lint/FormatParameterMismatch:
Description: 'The number of parameters to format/sprint must match the fields.'
Enabled: true
VersionAdded: '0.33'
Lint/HandleExceptions:
Description: "Don't suppress exception."
StyleGuide: '#dont-hide-exceptions'
Enabled: true
VersionAdded: '0.9'
Lint/ImplicitStringConcatenation:
Description: >-
Checks for adjacent string literals on the same line, which
could better be represented as a single string literal.
Enabled: true
VersionAdded: '0.36'
Lint/IneffectiveAccessModifier:
Description: >-
Checks for attempts to use `private` or `protected` to set
the visibility of a class method, which does not work.
Enabled: true
VersionAdded: '0.36'
Lint/InheritException:
Description: 'Avoid inheriting from the `Exception` class.'
Enabled: true
VersionAdded: '0.41'
# The default base class in favour of `Exception`.
EnforcedStyle: runtime_error
SupportedStyles:
- runtime_error
- standard_error
Lint/InterpolationCheck:
Description: 'Raise warning for interpolation in single q strs'
Enabled: true
VersionAdded: '0.50'
Lint/LiteralAsCondition:
Description: 'Checks of literals used in conditions.'
Enabled: true
VersionAdded: '0.51'
Lint/LiteralInInterpolation:
Description: 'Checks for literals used in interpolation.'
Enabled: true
VersionAdded: '0.19'
VersionChanged: '0.32'
Lint/Loop:
Description: >-
Use Kernel#loop with break rather than begin/end/until or
begin/end/while for post-loop tests.
StyleGuide: '#loop-with-break'
Enabled: true
VersionAdded: '0.9'
Lint/MissingCopEnableDirective:
Description: 'Checks for a `# rubocop:enable` after `# rubocop:disable`'
Enabled: true
VersionAdded: '0.52'
# Maximum number of consecutive lines the cop can be disabled for.
# 0 allows only single-line disables
# 1 would mean the maximum allowed is the following:
# # rubocop:disable SomeCop
# a = 1
# # rubocop:enable SomeCop
# .inf for any size
MaximumRangeSize: .inf
Lint/MultipleCompare:
Description: "Use `&&` operator to compare multiple value."
Enabled: true
VersionAdded: '0.47'
Lint/NestedMethodDefinition:
Description: 'Do not use nested method definitions.'
StyleGuide: '#no-nested-methods'
Enabled: true
VersionAdded: '0.32'
Lint/NestedPercentLiteral:
Description: 'Checks for nested percent literals.'
Enabled: true
VersionAdded: '0.52'
Lint/NextWithoutAccumulator:
Description: >-
Do not omit the accumulator when calling `next`
in a `reduce`/`inject` block.
Enabled: true
VersionAdded: '0.36'
Lint/NonLocalExitFromIterator:
Description: 'Do not use return in iterator to cause non-local exit.'
Enabled: true
VersionAdded: '0.30'
Lint/NumberConversion:
Description: 'Checks unsafe usage of number conversion methods.'
Enabled: false
VersionAdded: '0.53'
Lint/OrderedMagicComments:
Description: 'Checks the proper ordering of magic comments and whether a magic comment is not placed before a shebang.'
Enabled: true
VersionAdded: '0.53'
Lint/ParenthesesAsGroupedExpression:
Description: >-
Checks for method calls with a space before the opening
parenthesis.
StyleGuide: '#parens-no-spaces'
Enabled: true
VersionAdded: '0.12'
Lint/PercentStringArray:
Description: >-
Checks for unwanted commas and quotes in %w/%W literals.
Enabled: true
VersionAdded: '0.41'
Lint/PercentSymbolArray:
Description: >-
Checks for unwanted commas and colons in %i/%I literals.
Enabled: true
VersionAdded: '0.41'
Lint/RandOne:
Description: >-
Checks for `rand(1)` calls. Such calls always return `0`
and most likely a mistake.
Enabled: true
VersionAdded: '0.36'
Lint/RedundantWithIndex:
Description: 'Checks for redundant `with_index`.'
Enabled: true
VersionAdded: '0.50'
Lint/RedundantWithObject:
Description: 'Checks for redundant `with_object`.'
Enabled: true
VersionAdded: '0.51'
Lint/RegexpAsCondition:
Description: >-
Do not use regexp literal as a condition.
The regexp literal matches `$_` implicitly.
Enabled: true
VersionAdded: '0.51'
Lint/RequireParentheses:
Description: >-
Use parentheses in the method call to avoid confusion
about precedence.
Enabled: true
VersionAdded: '0.18'
Lint/RescueException:
Description: 'Avoid rescuing the Exception class.'
StyleGuide: '#no-blind-rescues'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.27.1'
Lint/RescueType:
Description: 'Avoid rescuing from non constants that could result in a `TypeError`.'
Enabled: true
VersionAdded: '0.49'
Lint/ReturnInVoidContext:
Description: 'Checks for return in void context.'
Enabled: true
VersionAdded: '0.50'
Lint/SafeNavigationChain:
Description: 'Do not chain ordinary method call after safe navigation operator.'
Enabled: true
VersionAdded: '0.47'
VersionChanged: '0.56'
Whitelist:
- present?
- blank?
- presence
- try
- try!
Lint/SafeNavigationConsistency:
Description: >-
Check to make sure that if safe navigation is used for a method
call in an `&&` or `||` condition that safe navigation is used
for all method calls on that same object.
Enabled: true
VersionAdded: '0.55'
Whitelist:
- present?
- blank?
- presence
- try
- try!
Lint/ScriptPermission:
Description: 'Grant script file execute permission.'
Enabled: true
VersionAdded: '0.49'
VersionChanged: '0.50'
Lint/ShadowedArgument:
Description: 'Avoid reassigning arguments before they were used.'
Enabled: true
VersionAdded: '0.52'
IgnoreImplicitReferences: false
Lint/ShadowedException:
Description: >-
Avoid rescuing a higher level exception
before a lower level exception.
Enabled: true
VersionAdded: '0.41'
Lint/ShadowingOuterLocalVariable:
Description: >-
Do not use the same name as outer local variable
for block arguments or block local variables.
Enabled: true
VersionAdded: '0.9'
Lint/StringConversionInInterpolation:
Description: 'Checks for Object#to_s usage in string interpolation.'
StyleGuide: '#no-to-s'
Enabled: true
VersionAdded: '0.19'
VersionChanged: '0.20'
Lint/Syntax:
Description: 'Checks syntax error'
Enabled: true
VersionAdded: '0.9'
Lint/UnderscorePrefixedVariableName:
Description: 'Do not use prefix `_` for a variable that is used.'
Enabled: true
VersionAdded: '0.21'
Lint/UnifiedInteger:
Description: 'Use Integer instead of Fixnum or Bignum'
Enabled: true
VersionAdded: '0.43'
Lint/UnneededCopDisableDirective:
Description: >-
Checks for rubocop:disable comments that can be removed.
Note: this cop is not disabled when disabling all cops.
It must be explicitly disabled.
Enabled: true
VersionAdded: '0.53'
Lint/UnneededCopEnableDirective:
Description: Checks for rubocop:enable comments that can be removed.
Enabled: true
VersionAdded: '0.53'
Lint/UnneededRequireStatement:
Description: 'Checks for unnecessary `require` statement.'
Enabled: true
VersionAdded: '0.51'
Lint/UnneededSplatExpansion:
Description: 'Checks for splat unnecessarily being called on literals'
Enabled: true
VersionAdded: '0.43'
Lint/UnreachableCode:
Description: 'Unreachable code.'
Enabled: true
VersionAdded: '0.9'
Lint/UnusedBlockArgument:
Description: 'Checks for unused block arguments.'
StyleGuide: '#underscore-unused-vars'
Enabled: true
VersionAdded: '0.21'
VersionChanged: '0.22'
IgnoreEmptyBlocks: true
AllowUnusedKeywordArguments: false
Lint/UnusedMethodArgument:
Description: 'Checks for unused method arguments.'
StyleGuide: '#underscore-unused-vars'
Enabled: true
VersionAdded: '0.21'
VersionChanged: '0.35'
AllowUnusedKeywordArguments: false
IgnoreEmptyMethods: true
Lint/UriEscapeUnescape:
Description: >-
`URI.escape` method is obsolete and should not be used. Instead, use
`CGI.escape`, `URI.encode_www_form` or `URI.encode_www_form_component`
depending on your specific use case.
Also `URI.unescape` method is obsolete and should not be used. Instead, use
`CGI.unescape`, `URI.decode_www_form` or `URI.decode_www_form_component`
depending on your specific use case.
Enabled: true
VersionAdded: '0.50'
Lint/UriRegexp:
Description: 'Use `URI::DEFAULT_PARSER.make_regexp` instead of `URI.regexp`.'
Enabled: true
VersionAdded: '0.50'
Lint/UselessAccessModifier:
Description: 'Checks for useless access modifiers.'
Enabled: true
VersionAdded: '0.20'
VersionChanged: '0.47'
ContextCreatingMethods: []
MethodCreatingMethods: []
Lint/UselessAssignment:
Description: 'Checks for useless assignment to a local variable.'
StyleGuide: '#underscore-unused-vars'
Enabled: true
VersionAdded: '0.11'
Lint/UselessComparison:
Description: 'Checks for comparison of something with itself.'
Enabled: true
VersionAdded: '0.11'
Lint/UselessElseWithoutRescue:
Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
Enabled: true
VersionAdded: '0.17'
Lint/UselessSetterCall:
Description: 'Checks for useless setter call to a local variable.'
Enabled: true
VersionAdded: '0.13'
Lint/Void:
Description: 'Possible use of operator/literal/variable in void context.'
Enabled: true
VersionAdded: '0.9'
CheckForMethodsWithNoSideEffects: false
#################### Metrics ###############################
Metrics/AbcSize:
Description: >-
A calculated magnitude based on number of assignments,
branches, and conditions.
Reference: 'http://c2.com/cgi/wiki?AbcMetric'
Enabled: true
VersionAdded: '0.27'
# The ABC size is a calculated magnitude, so this number can be an Integer or
# a Float.
Max: 15
Metrics/BlockLength:
Description: 'Avoid long blocks with many lines.'
Enabled: true
VersionAdded: '0.44'
VersionChanged: '0.58'
CountComments: false # count full line comments?
Max: 25
ExcludedMethods:
# By default, exclude the `#refine` method, as it tends to have larger
# associated blocks.
- refine
Metrics/BlockNesting:
Description: 'Avoid excessive block nesting'
StyleGuide: '#three-is-the-number-thou-shalt-count'
Enabled: true
VersionAdded: '0.25'
VersionChanged: '0.47'
CountBlocks: false
Max: 3
Metrics/ClassLength:
Description: 'Avoid classes longer than 100 lines of code.'
Enabled: true
VersionAdded: '0.25'
CountComments: false # count full line comments?
Max: 100
# Avoid complex methods.
Metrics/CyclomaticComplexity:
Description: >-
A complexity metric that is strongly correlated to the number
of test cases needed to validate a method.
Enabled: true
VersionAdded: '0.25'
Max: 6
Metrics/LineLength:
Description: 'Limit lines to 80 characters.'
StyleGuide: '#80-character-limits'
Enabled: true
VersionAdded: '0.25'
VersionChanged: '0.46'
Max: 80
# To make it possible to copy or click on URIs in the code, we allow lines
# containing a URI to be longer than Max.
AllowHeredoc: true
AllowURI: true
URISchemes:
- http
- https
# The IgnoreCopDirectives option causes the LineLength rule to ignore cop
# directives like '# rubocop: enable ...' when calculating a line's length.
IgnoreCopDirectives: false
# The IgnoredPatterns option is a list of !ruby/regexp and/or string
# elements. Strings will be converted to Regexp objects. A line that matches
# any regular expression listed in this option will be ignored by LineLength.
IgnoredPatterns: []
Metrics/MethodLength:
Description: 'Avoid methods longer than 10 lines of code.'
StyleGuide: '#short-methods'
Enabled: true
VersionAdded: '0.25'
VersionChanged: '0.59.2'
CountComments: false # count full line comments?
Max: 10
ExcludedMethods: []
Metrics/ModuleLength:
Description: 'Avoid modules longer than 100 lines of code.'
Enabled: true
VersionAdded: '0.31'
CountComments: false # count full line comments?
Max: 100
Metrics/ParameterLists:
Description: 'Avoid parameter lists longer than three or four parameters.'
StyleGuide: '#too-many-params'
Enabled: true
VersionAdded: '0.25'
Max: 5
CountKeywordArgs: true
Metrics/PerceivedComplexity:
Description: >-
A complexity metric geared towards measuring complexity for a
human reader.
Enabled: true
VersionAdded: '0.25'
Max: 7
#################### Naming ##############################
Naming/AccessorMethodName:
Description: Check the naming of accessor methods for get_/set_.
StyleGuide: '#accessor_mutator_method_names'
Enabled: true
VersionAdded: '0.50'
Naming/AsciiIdentifiers:
Description: 'Use only ascii symbols in identifiers.'
StyleGuide: '#english-identifiers'
Enabled: true
VersionAdded: '0.50'
Naming/BinaryOperatorParameterName:
Description: 'When defining binary operators, name the argument other.'
StyleGuide: '#other-arg'
Enabled: true
VersionAdded: '0.50'
Naming/ClassAndModuleCamelCase:
Description: 'Use CamelCase for classes and modules.'
StyleGuide: '#camelcase-classes'
Enabled: true
VersionAdded: '0.50'
Naming/ConstantName:
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
StyleGuide: '#screaming-snake-case'
Enabled: true
VersionAdded: '0.50'
Naming/FileName:
Description: 'Use snake_case for source file names.'
StyleGuide: '#snake-case-files'
Enabled: true
VersionAdded: '0.50'
# Camel case file names listed in `AllCops:Include` and all file names listed
# in `AllCops:Exclude` are excluded by default. Add extra excludes here.
Exclude: []
# When `true`, requires that each source file should define a class or module
# with a name which matches the file name (converted to ... case).
# It further expects it to be nested inside modules which match the names
# of subdirectories in its path.
ExpectMatchingDefinition: false
# If non-`nil`, expect all source file names to match the following regex.
# Only the file name itself is matched, not the entire file path.
# Use anchors as necessary if you want to match the entire name rather than
# just a part of it.
Regex: ~
# With `IgnoreExecutableScripts` set to `true`, this cop does not
# report offending filenames for executable scripts (i.e. source
# files with a shebang in the first line).
IgnoreExecutableScripts: true
AllowedAcronyms:
- CLI
- DSL
- ACL
- API
- ASCII
- CPU
- CSS
- DNS
- EOF
- GUID
- HTML
- HTTP
- HTTPS
- ID
- IP
- JSON
- LHS
- QPS
- RAM
- RHS
- RPC
- SLA
- SMTP
- SQL
- SSH
- TCP
- TLS
- TTL
- UDP
- UI
- UID
- UUID
- URI
- URL
- UTF8
- VM
- XML
- XMPP
- XSRF
- XSS
Naming/HeredocDelimiterCase:
Description: 'Use configured case for heredoc delimiters.'
StyleGuide: '#heredoc-delimiters'
Enabled: true
VersionAdded: '0.50'
EnforcedStyle: uppercase
SupportedStyles:
- lowercase
- uppercase
Naming/HeredocDelimiterNaming:
Description: 'Use descriptive heredoc delimiters.'
StyleGuide: '#heredoc-delimiters'
Enabled: true
VersionAdded: '0.50'
Blacklist:
- !ruby/regexp '/(^|\s)(EO[A-Z]{1}|END)(\s|$)/'
Naming/MemoizedInstanceVariableName:
Description: >-
Memoized method name should match memo instance variable name.
Enabled: true
VersionAdded: '0.53'
VersionChanged: '0.58'
EnforcedStyleForLeadingUnderscores: disallowed
SupportedStylesForLeadingUnderscores:
- disallowed
- required
- optional
Naming/MethodName:
Description: 'Use the configured style when naming methods.'
StyleGuide: '#snake-case-symbols-methods-vars'
Enabled: true
VersionAdded: '0.50'
EnforcedStyle: snake_case
SupportedStyles:
- snake_case
- camelCase
Naming/PredicateName:
Description: 'Check the names of predicate methods.'
StyleGuide: '#bool-methods-qmark'
Enabled: true
VersionAdded: '0.50'
VersionChanged: '0.51'
# Predicate name prefixes.
NamePrefix:
- is_
- has_
- have_
# Predicate name prefixes that should be removed.
NamePrefixBlacklist:
- is_
- has_
- have_
# Predicate names which, despite having a blacklisted prefix, or no `?`,
# should still be accepted
NameWhitelist:
- is_a?
# Method definition macros for dynamically generated methods.
MethodDefinitionMacros:
- define_method
- define_singleton_method
# Exclude Rspec specs because there is a strong convention to write spec
# helpers in the form of `have_something` or `be_something`.
Exclude:
- 'spec/**/*'
Naming/UncommunicativeBlockParamName:
Description: >-
Checks for block parameter names that contain capital letters,
end in numbers, or do not meet a minimal length.
Enabled: true
VersionAdded: '0.53'
# Parameter names may be equal to or greater than this value
MinNameLength: 1
AllowNamesEndingInNumbers: true
# Whitelisted names that will not register an offense
AllowedNames: []
# Blacklisted names that will register an offense
ForbiddenNames: []
Naming/UncommunicativeMethodParamName:
Description: >-
Checks for method parameter names that contain capital letters,
end in numbers, or do not meet a minimal length.
Enabled: true
VersionAdded: '0.53'
VersionChanged: '0.59'
# Parameter names may be equal to or greater than this value
MinNameLength: 3
AllowNamesEndingInNumbers: true
# Whitelisted names that will not register an offense
AllowedNames:
- io
- id
- to
- by
- 'on'
- in
- at
- ip
- db
# Blacklisted names that will register an offense
ForbiddenNames: []
Naming/VariableName:
Description: 'Use the configured style when naming variables.'
StyleGuide: '#snake-case-symbols-methods-vars'
Enabled: true
VersionAdded: '0.50'
EnforcedStyle: snake_case
SupportedStyles:
- snake_case
- camelCase
Naming/VariableNumber:
Description: 'Use the configured style when numbering variables.'
Enabled: true
VersionAdded: '0.50'
EnforcedStyle: normalcase
SupportedStyles:
- snake_case
- normalcase
- non_integer
#################### Performance ###########################
Performance/Caller:
Description: >-
Use `caller(n..n)` instead of `caller`.
Enabled: true
VersionAdded: '0.49'
Performance/CaseWhenSplat:
Description: >-
Reordering `when` conditions with a splat to the end
of the `when` branches can improve performance.
Enabled: false
AutoCorrect: false
SafeAutoCorrect: false
VersionAdded: '0.34'
VersionChanged: '0.59'
Performance/Casecmp:
Description: >-
Use `casecmp` rather than `downcase ==`, `upcase ==`, `== downcase`, or `== upcase`..
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringcasecmp-vs-stringdowncase---code'
Enabled: true
VersionAdded: '0.36'
Performance/ChainArrayAllocation:
Description: >-
Instead of chaining array methods that allocate new arrays, mutate an
existing array.
Reference: 'https://twitter.com/schneems/status/1034123879978029057'
Enabled: false
VersionAdded: '0.59'
Performance/CompareWithBlock:
Description: 'Use `sort_by(&:foo)` instead of `sort { |a, b| a.foo <=> b.foo }`.'
Enabled: true
VersionAdded: '0.46'
Performance/Count:
Description: >-
Use `count` instead of `select...size`, `reject...size`,
`select...count`, `reject...count`, `select...length`,
and `reject...length`.
# This cop has known compatibility issues with `ActiveRecord` and other
# frameworks. ActiveRecord's `count` ignores the block that is passed to it.
# For more information, see the documentation in the cop itself.
# If you understand the known risk, you can disable `SafeMode`.
SafeMode: true
Enabled: true
VersionAdded: '0.31'
VersionChanged: '0.39'
Performance/Detect:
Description: >-
Use `detect` instead of `select.first`, `find_all.first`,
`select.last`, and `find_all.last`.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
# This cop has known compatibility issues with `ActiveRecord` and other
# frameworks. `ActiveRecord` does not implement a `detect` method and `find`
# has its own meaning. Correcting `ActiveRecord` methods with this cop
# should be considered unsafe.
SafeMode: true
Enabled: true
VersionAdded: '0.30'
VersionChanged: '0.39'
Performance/DoubleStartEndWith:
Description: >-
Use `str.{start,end}_with?(x, ..., y, ...)`
instead of `str.{start,end}_with?(x, ...) || str.{start,end}_with?(y, ...)`.
Enabled: true
VersionAdded: '0.36'
VersionChanged: '0.48'
# Used to check for `starts_with?` and `ends_with?`.
# These methods are defined by `ActiveSupport`.
IncludeActiveSupportAliases: false
Performance/EndWith:
Description: 'Use `end_with?` instead of a regex match anchored to the end of a string.'
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
# This will change to a new method call which isn't guaranteed to be on the
# object. Switching these methods has to be done with knowledge of the types
# of the variables which rubocop doesn't have.
SafeAutoCorrect: false
AutoCorrect: false
Enabled: true
VersionAdded: '0.36'
VersionChanged: '0.44'
Performance/FixedSize:
Description: 'Do not compute the size of statically sized objects except in constants'
Enabled: true
VersionAdded: '0.35'
Performance/FlatMap:
Description: >-
Use `Enumerable#flat_map`
instead of `Enumerable#map...Array#flatten(1)`
or `Enumberable#collect..Array#flatten(1)`
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
Enabled: true
VersionAdded: '0.30'
EnabledForFlattenWithoutParams: false
# If enabled, this cop will warn about usages of
# `flatten` being called without any parameters.
# This can be dangerous since `flat_map` will only flatten 1 level, and
# `flatten` without any parameters can flatten multiple levels.
Performance/InefficientHashSearch:
Description: 'Use `key?` or `value?` instead of `keys.include?` or `values.include?`'
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashkey-instead-of-hashkeysinclude-code'
Enabled: true
VersionAdded: '0.56'
Safe: false
Performance/LstripRstrip:
Description: 'Use `strip` instead of `lstrip.rstrip`.'
Enabled: true
VersionAdded: '0.36'
Performance/OpenStruct:
Description: 'Use `Struct` instead of `OpenStruct`.'
Enabled: false
VersionAdded: '0.61'
Safe: false
Performance/RangeInclude:
Description: 'Use `Range#cover?` instead of `Range#include?`.'
Reference: 'https://github.com/JuanitoFatas/fast-ruby#cover-vs-include-code'
Enabled: true
VersionAdded: '0.36'
Performance/RedundantBlockCall:
Description: 'Use `yield` instead of `block.call`.'
Reference: 'https://github.com/JuanitoFatas/fast-ruby#proccall-and-block-arguments-vs-yieldcode'
Enabled: true
VersionAdded: '0.36'
Performance/RedundantMatch:
Description: >-
Use `=~` instead of `String#match` or `Regexp#match` in a context where the
returned `MatchData` is not needed.
Enabled: true
VersionAdded: '0.36'
Performance/RedundantMerge:
Description: 'Use Hash#[]=, rather than Hash#merge! with a single key-value pair.'
Reference: 'https://github.com/JuanitoFatas/fast-ruby#hashmerge-vs-hash-code'
Enabled: true
VersionAdded: '0.36'
# Max number of key-value pairs to consider an offense
MaxKeyValuePairs: 2
Performance/RedundantSortBy:
Description: 'Use `sort` instead of `sort_by { |x| x }`.'
Enabled: true
VersionAdded: '0.36'
Performance/RegexpMatch:
Description: >-
Use `match?` instead of `Regexp#match`, `String#match`, `Symbol#match`,
`Regexp#===`, or `=~` when `MatchData` is not used.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#regexp-vs-stringmatch-vs-string-vs-stringmatch-code-'
Enabled: true
VersionAdded: '0.47'
Performance/ReverseEach:
Description: 'Use `reverse_each` instead of `reverse.each`.'
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
Enabled: true
VersionAdded: '0.30'
Performance/Sample:
Description: >-
Use `sample` instead of `shuffle.first`,
`shuffle.last`, and `shuffle[Integer]`.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
Enabled: true
VersionAdded: '0.30'
Performance/Size:
Description: >-
Use `size` instead of `count` for counting
the number of elements in `Array` and `Hash`.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraylength-vs-arraysize-vs-arraycount-code'
Enabled: true
VersionAdded: '0.30'
Performance/StartWith:
Description: 'Use `start_with?` instead of a regex match anchored to the beginning of a string.'
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringmatch-vs-stringstart_withstringend_with-code-start-code-end'
# This will change to a new method call which isn't guaranteed to be on the
# object. Switching these methods has to be done with knowledge of the types
# of the variables which rubocop doesn't have.
SafeAutoCorrect: false
AutoCorrect: false
Enabled: true
VersionAdded: '0.36'
VersionChanged: '0.44'
Performance/StringReplacement:
Description: >-
Use `tr` instead of `gsub` when you are replacing the same
number of characters. Use `delete` instead of `gsub` when
you are deleting characters.
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
Enabled: true
VersionAdded: '0.33'
Performance/TimesMap:
Description: 'Checks for .times.map calls.'
AutoCorrect: false
Enabled: true
VersionAdded: '0.36'
VersionChanged: '0.50'
SafeAutoCorrect: false # see https://github.com/rubocop-hq/rubocop/issues/4658
Performance/UnfreezeString:
Description: 'Use unary plus to get an unfrozen string literal.'
Enabled: true
VersionAdded: '0.50'
Performance/UnneededSort:
Description: >-
Use `min` instead of `sort.first`,
`max_by` instead of `sort_by...last`, etc.
Enabled: true
VersionAdded: '0.55'
Performance/UriDefaultParser:
Description: 'Use `URI::DEFAULT_PARSER` instead of `URI::Parser.new`.'
Enabled: true
VersionAdded: '0.50'
#################### Rails #################################
# By default, the rails cops are not run. Override in project or home
# directory .rubocop.yml files, or by giving the -R/--rails option.
Rails:
Enabled: false
Rails/ActionFilter:
Description: 'Enforces consistent use of action filter methods.'
Enabled: true
VersionAdded: '0.19'
EnforcedStyle: action
SupportedStyles:
- action
- filter
Include:
- app/controllers/**/*.rb
Rails/ActiveRecordAliases:
Description: >-
Avoid Active Record aliases:
Use `update` instead of `update_attributes`.
Use `update!` instead of `update_attributes!`.
Enabled: true
VersionAdded: '0.53'
Rails/ActiveSupportAliases:
Description: >-
Avoid ActiveSupport aliases of standard ruby methods:
`String#starts_with?`, `String#ends_with?`,
`Array#append`, `Array#prepend`.
Enabled: true
VersionAdded: '0.48'
Rails/ApplicationJob:
Description: 'Check that jobs subclass ApplicationJob.'
Enabled: true
VersionAdded: '0.49'
Rails/ApplicationRecord:
Description: 'Check that models subclass ApplicationRecord.'
Enabled: true
VersionAdded: '0.49'
Rails/AssertNot:
Description: 'Use `assert_not` instead of `assert !`.'
Enabled: true
VersionAdded: '0.56'
Include:
- '**/test/**/*'
Rails/Blank:
Description: 'Enforces use of `blank?`.'
Enabled: true
VersionAdded: '0.48'
# Convert usages of `nil? || empty?` to `blank?`
NilOrEmpty: true
# Convert usages of `!present?` to `blank?`
NotPresent: true
# Convert usages of `unless present?` to `if blank?`
UnlessPresent: true
Rails/BulkChangeTable:
Description: 'Check whether alter queries are combinable.'
Enabled: true
VersionAdded: '0.57'
Database: null
SupportedDatabases:
- mysql
- postgresql
Include:
- db/migrate/*.rb
Rails/CreateTableWithTimestamps:
Description: >-
Checks the migration for which timestamps are not included
when creating a new table.
Enabled: true
VersionAdded: '0.52'
Include:
- db/migrate/*.rb
Rails/Date:
Description: >-
Checks the correct usage of date aware methods,
such as Date.today, Date.current etc.
Enabled: true
VersionAdded: '0.30'
VersionChanged: '0.33'
# The value `strict` disallows usage of `Date.today`, `Date.current`,
# `Date#to_time` etc.
# The value `flexible` allows usage of `Date.current`, `Date.yesterday`, etc
# (but not `Date.today`) which are overridden by ActiveSupport to handle current
# time zone.
EnforcedStyle: flexible
SupportedStyles:
- strict
- flexible
Rails/Delegate:
Description: 'Prefer delegate method for delegations.'
Enabled: true
VersionAdded: '0.21'
VersionChanged: '0.50'
# When set to true, using the target object as a prefix of the
# method name without using the `delegate` method will be a
# violation. When set to false, this case is legal.
EnforceForPrefixed: true
Rails/DelegateAllowBlank:
Description: 'Do not use allow_blank as an option to delegate.'
Enabled: true
VersionAdded: '0.44'
Rails/DynamicFindBy:
Description: 'Use `find_by` instead of dynamic `find_by_*`.'
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#find_by'
Enabled: true
VersionAdded: '0.44'
Whitelist:
- find_by_sql
Rails/EnumUniqueness:
Description: 'Avoid duplicate integers in hash-syntax `enum` declaration.'
Enabled: true
VersionAdded: '0.46'
Include:
- app/models/**/*.rb
Rails/EnvironmentComparison:
Description: "Favor `Rails.env.production?` over `Rails.env == 'production'`"
Enabled: true
VersionAdded: '0.52'
Rails/Exit:
Description: >-
Favor `fail`, `break`, `return`, etc. over `exit` in
application or library code outside of Rake files to avoid
exits during unit testing or running in production.
Enabled: true
VersionAdded: '0.41'
Include:
- app/**/*.rb
- config/**/*.rb
- lib/**/*.rb
Exclude:
- lib/**/*.rake
Rails/FilePath:
Description: 'Use `Rails.root.join` for file path joining.'
Enabled: true
VersionAdded: '0.47'
VersionChanged: '0.57'
EnforcedStyle: arguments
SupportedStyles:
- slashes
- arguments
Rails/FindBy:
Description: 'Prefer find_by over where.first.'
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#find_by'
Enabled: true
VersionAdded: '0.30'
Include:
- app/models/**/*.rb
Rails/FindEach:
Description: 'Prefer all.find_each over all.find.'
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#find-each'
Enabled: true
VersionAdded: '0.30'
Include:
- app/models/**/*.rb
Rails/HasAndBelongsToMany:
Description: 'Prefer has_many :through to has_and_belongs_to_many.'
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#has-many-through'
Enabled: true
VersionAdded: '0.12'
Include:
- app/models/**/*.rb
Rails/HasManyOrHasOneDependent:
Description: 'Define the dependent option to the has_many and has_one associations.'
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#has_many-has_one-dependent-option'
Enabled: true
VersionAdded: '0.50'
Include:
- app/models/**/*.rb
Rails/HttpPositionalArguments:
Description: 'Use keyword arguments instead of positional arguments in http method calls.'
Enabled: true
VersionAdded: '0.44'
Include:
- 'spec/**/*'
- 'test/**/*'
Rails/HttpStatus:
Description: 'Enforces use of symbolic or numeric value to define HTTP status.'
Enabled: true
VersionAdded: '0.54'
EnforcedStyle: symbolic
SupportedStyles:
- numeric
- symbolic
Rails/InverseOf:
Description: 'Checks for associations where the inverse cannot be determined automatically.'
Enabled: true
VersionAdded: '0.52'
Include:
- app/models/**/*.rb
Rails/LexicallyScopedActionFilter:
Description: "Checks that methods specified in the filter's `only` or `except` options are explicitly defined in the controller."
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#lexically-scoped-action-filter'
Enabled: true
VersionAdded: '0.52'
Include:
- app/controllers/**/*.rb
Rails/LinkToBlank:
Description: 'Checks that `link_to` with a `target: "_blank"` have a `rel: "noopener"` option passed to them.'
Reference: https://mathiasbynens.github.io/rel-noopener/
Enabled: true
VersionAdded: '0.62'
Rails/NotNullColumn:
Description: 'Do not add a NOT NULL column without a default value'
Enabled: true
VersionAdded: '0.43'
Include:
- db/migrate/*.rb
Rails/Output:
Description: 'Checks for calls to puts, print, etc.'
Enabled: true
VersionAdded: '0.15'
VersionChanged: '0.19'
Include:
- app/**/*.rb
- config/**/*.rb
- db/**/*.rb
- lib/**/*.rb
Rails/OutputSafety:
Description: 'The use of `html_safe` or `raw` may be a security risk.'
Enabled: true
VersionAdded: '0.41'
Rails/PluralizationGrammar:
Description: 'Checks for incorrect grammar when using methods like `3.day.ago`.'
Enabled: true
VersionAdded: '0.35'
Rails/Presence:
Description: 'Checks code that can be written more easily using `Object#presence` defined by Active Support.'
Enabled: true
VersionAdded: '0.52'
Rails/Present:
Description: 'Enforces use of `present?`.'
Enabled: true
VersionAdded: '0.48'
# Convert usages of `!nil? && !empty?` to `present?`
NotNilAndNotEmpty: true
# Convert usages of `!blank?` to `present?`
NotBlank: true
# Convert usages of `unless blank?` to `if present?`
UnlessBlank: true
Rails/ReadWriteAttribute:
Description: >-
Checks for read_attribute(:attr) and
write_attribute(:attr, val).
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#read-attribute'
Enabled: true
VersionAdded: '0.20'
VersionChanged: '0.29'
Include:
- app/models/**/*.rb
Rails/RedundantReceiverInWithOptions:
Description: 'Checks for redundant receiver in `with_options`.'
Enabled: true
VersionAdded: '0.52'
Rails/RefuteMethods:
Description: 'Use `assert_not` methods instead of `refute` methods.'
Enabled: true
VersionAdded: '0.56'
Include:
- '**/test/**/*'
Rails/RelativeDateConstant:
Description: 'Do not assign relative date to constants.'
Enabled: true
VersionAdded: '0.48'
VersionChanged: '0.59'
AutoCorrect: false
Rails/RequestReferer:
Description: 'Use consistent syntax for request.referer.'
Enabled: true
VersionAdded: '0.41'
EnforcedStyle: referer
SupportedStyles:
- referer
- referrer
Rails/ReversibleMigration:
Description: 'Checks whether the change method of the migration file is reversible.'
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#reversible-migration'
Reference: 'https://api.rubyonrails.org/classes/ActiveRecord/Migration/CommandRecorder.html'
Enabled: true
VersionAdded: '0.47'
Include:
- db/migrate/*.rb
Rails/SafeNavigation:
Description: "Use Ruby's safe navigation operator (`&.`) instead of `try!`"
Enabled: true
VersionAdded: '0.43'
# This will convert usages of `try` to use safe navigation as well as `try!`.
# `try` and `try!` work slightly differently. `try!` and safe navigation will
# both raise a `NoMethodError` if the receiver of the method call does not
# implement the intended method. `try` will not raise an exception for this.
ConvertTry: false
Rails/SaveBang:
Description: 'Identifies possible cases where Active Record save! or related should be used.'
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#save-bang'
Enabled: false
VersionAdded: '0.42'
VersionChanged: '0.59'
AllowImplicitReturn: true
AllowedReceivers: []
Rails/ScopeArgs:
Description: 'Checks the arguments of ActiveRecord scopes.'
Enabled: true
VersionAdded: '0.19'
Include:
- app/models/**/*.rb
Rails/SkipsModelValidations:
Description: >-
Use methods that skips model validations with caution.
See reference for more information.
Reference: 'https://guides.rubyonrails.org/active_record_validations.html#skipping-validations'
Enabled: true
VersionAdded: '0.47'
VersionChanged: '0.60'
Blacklist:
- decrement!
- decrement_counter
- increment!
- increment_counter
- toggle!
- touch
- update_all
- update_attribute
- update_column
- update_columns
- update_counters
Whitelist: []
Rails/TimeZone:
Description: 'Checks the correct usage of time zone aware methods.'
StyleGuide: 'https://github.com/rubocop-hq/rails-style-guide#time'
Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
Enabled: true
VersionAdded: '0.30'
VersionChanged: '0.33'
# The value `strict` means that `Time` should be used with `zone`.
# The value `flexible` allows usage of `in_time_zone` instead of `zone`.
EnforcedStyle: flexible
SupportedStyles:
- strict
- flexible
Rails/UniqBeforePluck:
Description: 'Prefer the use of uniq or distinct before pluck.'
Enabled: true
VersionAdded: '0.40'
VersionChanged: '0.47'
EnforcedStyle: conservative
SupportedStyles:
- conservative
- aggressive
AutoCorrect: false
Rails/UnknownEnv:
Description: 'Use correct environment name.'
Enabled: true
VersionAdded: '0.51'
Environments:
- development
- test
- production
Rails/Validation:
Description: 'Use validates :attribute, hash of validations.'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.41'
Include:
- app/models/**/*.rb
#################### Security ##############################
Security/Eval:
Description: 'The use of eval represents a serious security risk.'
Enabled: true
VersionAdded: '0.47'
Security/JSONLoad:
Description: >-
Prefer usage of `JSON.parse` over `JSON.load` due to potential
security issues. See reference for more information.
Reference: 'https://ruby-doc.org/stdlib-2.3.0/libdoc/json/rdoc/JSON.html#method-i-load'
Enabled: true
VersionAdded: '0.43'
VersionChanged: '0.44'
# Autocorrect here will change to a method that may cause crashes depending
# on the value of the argument.
AutoCorrect: false
SafeAutoCorrect: false
Security/MarshalLoad:
Description: >-
Avoid using of `Marshal.load` or `Marshal.restore` due to potential
security issues. See reference for more information.
Reference: 'https://ruby-doc.org/core-2.3.3/Marshal.html#module-Marshal-label-Security+considerations'
Enabled: true
VersionAdded: '0.47'
Security/Open:
Description: 'The use of Kernel#open represents a serious security risk.'
Enabled: true
VersionAdded: '0.53'
Safe: false
Security/YAMLLoad:
Description: >-
Prefer usage of `YAML.safe_load` over `YAML.load` due to potential
security issues. See reference for more information.
Reference: 'https://ruby-doc.org/stdlib-2.3.3/libdoc/yaml/rdoc/YAML.html#module-YAML-label-Security'
Enabled: true
VersionAdded: '0.47'
SafeAutoCorrect: false
#################### Style ###############################
Style/AccessModifierDeclarations:
Description: 'Checks style of how access modifiers are used.'
Enabled: true
VersionAdded: '0.57'
EnforcedStyle: group
SupportedStyles:
- inline
- group
Style/Alias:
Description: 'Use alias instead of alias_method.'
StyleGuide: '#alias-method'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.36'
EnforcedStyle: prefer_alias
SupportedStyles:
- prefer_alias
- prefer_alias_method
Style/AndOr:
Description: 'Use &&/|| instead of and/or.'
StyleGuide: '#no-and-or-or'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.25'
# Whether `and` and `or` are banned only in conditionals (conditionals)
# or completely (always).
EnforcedStyle: always
SupportedStyles:
- always
- conditionals
Style/ArrayJoin:
Description: 'Use Array#join instead of Array#*.'
StyleGuide: '#array-join'
Enabled: true
VersionAdded: '0.20'
VersionChanged: '0.31'
Style/AsciiComments:
Description: 'Use only ascii symbols in comments.'
StyleGuide: '#english-comments'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.52'
AllowedChars: []
Style/Attr:
Description: 'Checks for uses of Module#attr.'
StyleGuide: '#attr'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.12'
Style/AutoResourceCleanup:
Description: 'Suggests the usage of an auto resource cleanup version of a method (if available).'
Enabled: false
VersionAdded: '0.30'
Style/BarePercentLiterals:
Description: 'Checks if usage of %() or %Q() matches configuration.'
StyleGuide: '#percent-q-shorthand'
Enabled: true
VersionAdded: '0.25'
EnforcedStyle: bare_percent
SupportedStyles:
- percent_q
- bare_percent
Style/BeginBlock:
Description: 'Avoid the use of BEGIN blocks.'
StyleGuide: '#no-BEGIN-blocks'
Enabled: true
VersionAdded: '0.9'
Style/BlockComments:
Description: 'Do not use block comments.'
StyleGuide: '#no-block-comments'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.23'
Style/BlockDelimiters:
Description: >-
Avoid using {...} for multi-line blocks (multiline chaining is
always ugly).
Prefer {...} over do...end for single-line blocks.
StyleGuide: '#single-line-blocks'
Enabled: true
VersionAdded: '0.30'
VersionChanged: '0.35'
EnforcedStyle: line_count_based
SupportedStyles:
# The `line_count_based` style enforces braces around single line blocks and
# do..end around multi-line blocks.
- line_count_based
# The `semantic` style enforces braces around functional blocks, where the
# primary purpose of the block is to return a value and do..end for
# procedural blocks, where the primary purpose of the block is its
# side-effects.
#
# This looks at the usage of a block's method to determine its type (e.g. is
# the result of a `map` assigned to a variable or passed to another
# method) but exceptions are permitted in the `ProceduralMethods`,
# `FunctionalMethods` and `IgnoredMethods` sections below.
- semantic
# The `braces_for_chaining` style enforces braces around single line blocks
# and do..end around multi-line blocks, except for multi-line blocks whose
# return value is being chained with another method (in which case braces
# are enforced).
- braces_for_chaining
ProceduralMethods:
# Methods that are known to be procedural in nature but look functional from
# their usage, e.g.
#
# time = Benchmark.realtime do
# foo.bar
# end
#
# Here, the return value of the block is discarded but the return value of
# `Benchmark.realtime` is used.
- benchmark
- bm
- bmbm
- create
- each_with_object
- measure
- new
- realtime
- tap
- with_object
FunctionalMethods:
# Methods that are known to be functional in nature but look procedural from
# their usage, e.g.
#
# let(:foo) { Foo.new }
#
# Here, the return value of `Foo.new` is used to define a `foo` helper but
# doesn't appear to be used from the return value of `let`.
- let
- let!
- subject
- watch
IgnoredMethods:
# Methods that can be either procedural or functional and cannot be
# categorised from their usage alone, e.g.
#
# foo = lambda do |x|
# puts "Hello, #{x}"
# end
#
# foo = lambda do |x|
# x * 100
# end
#
# Here, it is impossible to tell from the return value of `lambda` whether
# the inner block's return value is significant.
- lambda
- proc
- it
Style/BracesAroundHashParameters:
Description: 'Enforce braces style around hash parameters.'
Enabled: true
VersionAdded: '0.14.1'
VersionChanged: '0.28'
EnforcedStyle: no_braces
SupportedStyles:
# The `braces` style enforces braces around all method parameters that are
# hashes.
- braces
# The `no_braces` style checks that the last parameter doesn't have braces
# around it.
- no_braces
# The `context_dependent` style checks that the last parameter doesn't have
# braces around it, but requires braces if the second to last parameter is
# also a hash literal.
- context_dependent
Style/CaseEquality:
Description: 'Avoid explicit use of the case equality operator(===).'
StyleGuide: '#no-case-equality'
Enabled: true
VersionAdded: '0.9'
Style/CharacterLiteral:
Description: 'Checks for uses of character literals.'
StyleGuide: '#no-character-literals'
Enabled: true
VersionAdded: '0.9'
Style/ClassAndModuleChildren:
Description: 'Checks style of children classes and modules.'
StyleGuide: '#namespace-definition'
# Moving from compact to nested children requires knowledge of whether the
# outer parent is a module or a class. Moving from nested to compact requires
# verification that the outer parent is defined elsewhere. Rubocop does not
# have the knowledge to perform either operation safely and thus requires
# manual oversight.
SafeAutoCorrect: false
AutoCorrect: false
Enabled: true
VersionAdded: '0.19'
#
# Basically there are two different styles:
#
# `nested` - have each child on a separate line
# class Foo
# class Bar
# end
# end
#
# `compact` - combine definitions as much as possible
# class Foo::Bar
# end
#
# The compact style is only forced, for classes or modules with one child.
EnforcedStyle: nested
SupportedStyles:
- nested
- compact
Style/ClassCheck:
Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
Enabled: true
VersionAdded: '0.24'
EnforcedStyle: is_a?
SupportedStyles:
- is_a?
- kind_of?
Style/ClassMethods:
Description: 'Use self when defining module/class methods.'
StyleGuide: '#def-self-class-methods'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.20'
Style/ClassVars:
Description: 'Avoid the use of class variables.'
StyleGuide: '#no-class-vars'
Enabled: true
VersionAdded: '0.13'
# Align with the style guide.
Style/CollectionMethods:
Description: 'Preferred collection methods.'
StyleGuide: '#map-find-select-reduce-size'
Enabled: false
VersionAdded: '0.9'
VersionChanged: '0.27'
Safe: false
# Mapping from undesired method to desired method
# e.g. to use `detect` over `find`:
#
# Style/CollectionMethods:
# PreferredMethods:
# find: detect
PreferredMethods:
collect: 'map'
collect!: 'map!'
inject: 'reduce'
detect: 'find'
find_all: 'select'
Style/ColonMethodCall:
Description: 'Do not use :: for method call.'
StyleGuide: '#double-colons'
Enabled: true
VersionAdded: '0.9'
Style/ColonMethodDefinition:
Description: 'Do not use :: for defining class methods.'
StyleGuide: '#colon-method-definition'
Enabled: true
VersionAdded: '0.52'
Style/CommandLiteral:
Description: 'Use `` or %x around command literals.'
StyleGuide: '#percent-x'
Enabled: true
VersionAdded: '0.30'
EnforcedStyle: backticks
# backticks: Always use backticks.
# percent_x: Always use `%x`.
# mixed: Use backticks on single-line commands, and `%x` on multi-line commands.
SupportedStyles:
- backticks
- percent_x
- mixed
# If `false`, the cop will always recommend using `%x` if one or more backticks
# are found in the command string.
AllowInnerBackticks: false
# Checks formatting of special comments
Style/CommentAnnotation:
Description: >-
Checks formatting of special comments
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
StyleGuide: '#annotate-keywords'
Enabled: true
VersionAdded: '0.10'
VersionChanged: '0.31'
Keywords:
- TODO
- FIXME
- OPTIMIZE
- HACK
- REVIEW
Style/CommentedKeyword:
Description: 'Do not place comments on the same line as certain keywords.'
Enabled: true
VersionAdded: '0.51'
Style/ConditionalAssignment:
Description: >-
Use the return value of `if` and `case` statements for
assignment to a variable and variable comparison instead
of assigning that variable inside of each branch.
Enabled: true
VersionAdded: '0.36'
VersionChanged: '0.47'
EnforcedStyle: assign_to_condition
SupportedStyles:
- assign_to_condition
- assign_inside_condition
# When configured to `assign_to_condition`, `SingleLineConditionsOnly`
# will only register an offense when all branches of a condition are
# a single line.
# When configured to `assign_inside_condition`, `SingleLineConditionsOnly`
# will only register an offense for assignment to a condition that has
# at least one multiline branch.
SingleLineConditionsOnly: true
IncludeTernaryExpressions: true
# Checks that you have put a copyright in a comment before any code.
#
# You can override the default Notice in your .rubocop.yml file.
#
# In order to use autocorrect, you must supply a value for the
# `AutocorrectNotice` key that matches the regexp Notice. A blank
# `AutocorrectNotice` will cause an error during autocorrect.
#
# Autocorrect will add a copyright notice in a comment at the top
# of the file immediately after any shebang or encoding comments.
#
# Example rubocop.yml:
#
# Style/Copyright:
# Enabled: true
# Notice: 'Copyright (\(c\) )?2015 Yahoo! Inc'
# AutocorrectNotice: '# Copyright (c) 2015 Yahoo! Inc.'
#
Style/Copyright:
Description: 'Include a copyright notice in each file before any code.'
Enabled: false
VersionAdded: '0.30'
Notice: '^Copyright (\(c\) )?2[0-9]{3} .+'
AutocorrectNotice: ''
Style/DateTime:
Description: 'Use Time over DateTime.'
StyleGuide: '#date--time'
Enabled: false
VersionAdded: '0.51'
VersionChanged: '0.59'
AllowCoercion: false
Style/DefWithParentheses:
Description: 'Use def with parentheses when there are arguments.'
StyleGuide: '#method-parens'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.12'
Style/Dir:
Description: >-
Use the `__dir__` method to retrieve the canonicalized
absolute path to the current file.
Enabled: true
VersionAdded: '0.50'
Style/Documentation:
Description: 'Document classes and non-namespace modules.'
Enabled: true
VersionAdded: '0.9'
Exclude:
- 'spec/**/*'
- 'test/**/*'
Style/DocumentationMethod:
Description: 'Checks for missing documentation comment for public methods.'
Enabled: false
VersionAdded: '0.43'
Exclude:
- 'spec/**/*'
- 'test/**/*'
RequireForNonPublicMethods: false
Style/DoubleNegation:
Description: 'Checks for uses of double negation (!!).'
StyleGuide: '#no-bang-bang'
Enabled: true
VersionAdded: '0.19'
Style/EachForSimpleLoop:
Description: >-
Use `Integer#times` for a simple loop which iterates a fixed
number of times.
Enabled: true
VersionAdded: '0.41'
Style/EachWithObject:
Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
Enabled: true
VersionAdded: '0.22'
VersionChanged: '0.42'
Style/EmptyBlockParameter:
Description: 'Omit pipes for empty block parameters.'
Enabled: true
VersionAdded: '0.52'
Style/EmptyCaseCondition:
Description: 'Avoid empty condition in case statements.'
Enabled: true
VersionAdded: '0.40'
Style/EmptyElse:
Description: 'Avoid empty else-clauses.'
Enabled: true
VersionAdded: '0.28'
VersionChanged: '0.32'
EnforcedStyle: both
# empty - warn only on empty `else`
# nil - warn on `else` with nil in it
# both - warn on empty `else` and `else` with `nil` in it
SupportedStyles:
- empty
- nil
- both
Style/EmptyLambdaParameter:
Description: 'Omit parens for empty lambda parameters.'
Enabled: true
VersionAdded: '0.52'
Style/EmptyLiteral:
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
StyleGuide: '#literal-array-hash'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.12'
Style/EmptyMethod:
Description: 'Checks the formatting of empty method definitions.'
StyleGuide: '#no-single-line-methods'
Enabled: true
VersionAdded: '0.46'
EnforcedStyle: compact
SupportedStyles:
- compact
- expanded
Style/Encoding:
Description: 'Use UTF-8 as the source file encoding.'
StyleGuide: '#utf-8'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.50'
Style/EndBlock:
Description: 'Avoid the use of END blocks.'
StyleGuide: '#no-END-blocks'
Enabled: true
VersionAdded: '0.9'
Style/EvalWithLocation:
Description: 'Pass `__FILE__` and `__LINE__` to `eval` method, as they are used by backtraces.'
Enabled: true
VersionAdded: '0.52'
Style/EvenOdd:
Description: 'Favor the use of Integer#even? && Integer#odd?'
StyleGuide: '#predicate-methods'
Enabled: true
VersionAdded: '0.12'
VersionChanged: '0.29'
Style/ExpandPathArguments:
Description: "Use `expand_path(__dir__)` instead of `expand_path('..', __FILE__)`."
Enabled: true
VersionAdded: '0.53'
Style/FlipFlop:
Description: 'Checks for flip flops'
StyleGuide: '#no-flip-flops'
Enabled: true
VersionAdded: '0.16'
Style/For:
Description: 'Checks use of for or each in multiline loops.'
StyleGuide: '#no-for-loops'
Enabled: true
VersionAdded: '0.13'
VersionChanged: '0.59'
EnforcedStyle: each
SupportedStyles:
- each
- for
Style/FormatString:
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
StyleGuide: '#sprintf'
Enabled: true
VersionAdded: '0.19'
VersionChanged: '0.49'
EnforcedStyle: format
SupportedStyles:
- format
- sprintf
- percent
Style/FormatStringToken:
Description: 'Use a consistent style for format string tokens.'
Enabled: true
EnforcedStyle: annotated
SupportedStyles:
# Prefer tokens which contain a sprintf like type annotation like
# `%<name>s`, `%<age>d`, `%<score>f`
- annotated
# Prefer simple looking "template" style tokens like `%{name}`, `%{age}`
- template
- unannotated
VersionAdded: '0.49'
VersionChanged: '0.52'
Style/FrozenStringLiteralComment:
Description: >-
Add the frozen_string_literal comment to the top of files
to help transition from Ruby 2.3.0 to Ruby 3.0.
Enabled: true
VersionAdded: '0.36'
VersionChanged: '0.47'
EnforcedStyle: when_needed
SupportedStyles:
# `when_needed` will add the frozen string literal comment to files
# only when the `TargetRubyVersion` is set to 2.3+.
- when_needed
# `always` will always add the frozen string literal comment to a file
# regardless of the Ruby version or if `freeze` or `<<` are called on a
# string literal. If you run code against multiple versions of Ruby, it is
# possible that this will create errors in Ruby 2.3.0+.
- always
# `never` will enforce that the frozen string literal comment does not
# exist in a file.
- never
Style/GlobalVars:
Description: 'Do not introduce global variables.'
StyleGuide: '#instance-vars'
Reference: 'https://www.zenspider.com/ruby/quickref.html'
Enabled: true
VersionAdded: '0.13'
# Built-in global variables are allowed by default.
AllowedVariables: []
Style/GuardClause:
Description: 'Check for conditionals that can be replaced with guard clauses'
StyleGuide: '#no-nested-conditionals'
Enabled: true
VersionAdded: '0.20'
VersionChanged: '0.22'
# `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
# needs to have to trigger this cop
MinBodyLength: 1
Style/HashSyntax:
Description: >-
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
{ :a => 1, :b => 2 }.
StyleGuide: '#hash-literals'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.43'
EnforcedStyle: ruby19
SupportedStyles:
# checks for 1.9 syntax (e.g. {a: 1}) for all symbol keys
- ruby19
# checks for hash rocket syntax for all hashes
- hash_rockets
# forbids mixed key syntaxes (e.g. {a: 1, :b => 2})
- no_mixed_keys
# enforces both ruby19 and no_mixed_keys styles
- ruby19_no_mixed_keys
# Force hashes that have a symbol value to use hash rockets
UseHashRocketsWithSymbolValues: false
# Do not suggest { a?: 1 } over { :a? => 1 } in ruby19 style
PreferHashRocketsForNonAlnumEndingSymbols: false
Style/IdenticalConditionalBranches:
Description: >-
Checks that conditional statements do not have an identical
line at the end of each branch, which can validly be moved
out of the conditional.
Enabled: true
VersionAdded: '0.36'
Style/IfInsideElse:
Description: 'Finds if nodes inside else, which can be converted to elsif.'
Enabled: true
VersionAdded: '0.36'
Style/IfUnlessModifier:
Description: >-
Favor modifier if/unless usage when you have a
single-line body.
StyleGuide: '#if-as-a-modifier'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.30'
Style/IfUnlessModifierOfIfUnless:
Description: >-
Avoid modifier if/unless usage on conditionals.
Enabled: true
VersionAdded: '0.39'
Style/IfWithSemicolon:
Description: 'Do not use if x; .... Use the ternary operator instead.'
StyleGuide: '#no-semicolon-ifs'
Enabled: true
VersionAdded: '0.9'
Style/ImplicitRuntimeError:
Description: >-
Use `raise` or `fail` with an explicit exception class and
message, rather than just a message.
Enabled: false
VersionAdded: '0.41'
Style/InfiniteLoop:
Description: 'Use Kernel#loop for infinite loops.'
StyleGuide: '#infinite-loop'
Enabled: true
VersionAdded: '0.26'
VersionChanged: '0.61'
SafeAutoCorrect: true
Style/InlineComment:
Description: 'Avoid trailing inline comments.'
Enabled: false
VersionAdded: '0.23'
Style/InverseMethods:
Description: >-
Use the inverse method instead of `!.method`
if an inverse method is defined.
Enabled: true
Safe: false
VersionAdded: '0.48'
# `InverseMethods` are methods that can be inverted by a not (`not` or `!`)
# The relationship of inverse methods only needs to be defined in one direction.
# Keys and values both need to be defined as symbols.
InverseMethods:
:any?: :none?
:even?: :odd?
:==: :!=
:=~: :!~
:<: :>=
:>: :<=
# `ActiveSupport` defines some common inverse methods. They are listed below,
# and not enabled by default.
#:present?: :blank?,
#:include?: :exclude?
# `InverseBlocks` are methods that are inverted by inverting the return
# of the block that is passed to the method
InverseBlocks:
:select: :reject
:select!: :reject!
Style/IpAddresses:
Description: "Don't include literal IP addresses in code."
Enabled: false
VersionAdded: '0.58'
# Allow strings to be whitelisted
Whitelist:
- "::"
# :: is a valid IPv6 address, but could potentially be legitimately in code
Style/Lambda:
Description: 'Use the new lambda literal syntax for single-line blocks.'
StyleGuide: '#lambda-multi-line'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.40'
EnforcedStyle: line_count_dependent
SupportedStyles:
- line_count_dependent
- lambda
- literal
Style/LambdaCall:
Description: 'Use lambda.call(...) instead of lambda.(...).'
StyleGuide: '#proc-call'
Enabled: true
VersionAdded: '0.13.1'
VersionChanged: '0.14'
EnforcedStyle: call
SupportedStyles:
- call
- braces
Style/LineEndConcatenation:
Description: >-
Use \ instead of + or << to concatenate two string literals at
line end.
Enabled: true
VersionAdded: '0.18'
Style/MethodCallWithArgsParentheses:
Description: 'Use parentheses for method calls with arguments.'
StyleGuide: '#method-invocation-parens'
Enabled: false
VersionAdded: '0.47'
VersionChanged: '0.61'
IgnoreMacros: true
IgnoredMethods: []
AllowParenthesesInMultilineCall: false
AllowParenthesesInChaining: false
EnforcedStyle: require_parentheses
SupportedStyles:
- require_parentheses
- omit_parentheses
Style/MethodCallWithoutArgsParentheses:
Description: 'Do not use parentheses for method calls with no arguments.'
StyleGuide: '#method-invocation-parens'
Enabled: true
IgnoredMethods: []
VersionAdded: '0.47'
VersionChanged: '0.55'
Style/MethodCalledOnDoEndBlock:
Description: 'Avoid chaining a method call on a do...end block.'
StyleGuide: '#single-line-blocks'
Enabled: false
VersionAdded: '0.14'
Style/MethodDefParentheses:
Description: >-
Checks if the method definitions have or don't have
parentheses.
StyleGuide: '#method-parens'
Enabled: true
VersionAdded: '0.16'
VersionChanged: '0.35'
EnforcedStyle: require_parentheses
SupportedStyles:
- require_parentheses
- require_no_parentheses
- require_no_parentheses_except_multiline
Style/MethodMissingSuper:
Description: Checks for `method_missing` to call `super`.
StyleGuide: '#no-method-missing'
Enabled: true
VersionAdded: '0.56'
Style/MinMax:
Description: >-
Use `Enumerable#minmax` instead of `Enumerable#min`
and `Enumerable#max` in conjunction.'
Enabled: true
VersionAdded: '0.50'
Style/MissingElse:
Description: >-
Require if/case expressions to have an else branches.
If enabled, it is recommended that
Style/UnlessElse and Style/EmptyElse be enabled.
This will conflict with Style/EmptyElse if
Style/EmptyElse is configured to style "both"
Enabled: false
VersionAdded: '0.30'
VersionChanged: '0.38'
EnforcedStyle: both
SupportedStyles:
# if - warn when an if expression is missing an else branch
# case - warn when a case expression is missing an else branch
# both - warn when an if or case expression is missing an else branch
- if
- case
- both
Style/MissingRespondToMissing:
Description: >-
Checks if `method_missing` is implemented
without implementing `respond_to_missing`.
StyleGuide: '#no-method-missing'
Enabled: true
VersionAdded: '0.56'
Style/MixinGrouping:
Description: 'Checks for grouping of mixins in `class` and `module` bodies.'
StyleGuide: '#mixin-grouping'
Enabled: true
VersionAdded: '0.48'
VersionChanged: '0.49'
EnforcedStyle: separated
SupportedStyles:
# separated: each mixed in module goes in a separate statement.
# grouped: mixed in modules are grouped into a single statement.
- separated
- grouped
Style/MixinUsage:
Description: 'Checks that `include`, `extend` and `prepend` exists at the top level.'
Enabled: true
VersionAdded: '0.51'
Style/ModuleFunction:
Description: 'Checks for usage of `extend self` in modules.'
StyleGuide: '#module-function'
Enabled: true
VersionAdded: '0.11'
VersionChanged: '0.53'
EnforcedStyle: module_function
SupportedStyles:
- module_function
- extend_self
Style/MultilineBlockChain:
Description: 'Avoid multi-line chains of blocks.'
StyleGuide: '#single-line-blocks'
Enabled: true
VersionAdded: '0.13'
Style/MultilineIfModifier:
Description: 'Only use if/unless modifiers on single line statements.'
StyleGuide: '#no-multiline-if-modifiers'
Enabled: true
VersionAdded: '0.45'
Style/MultilineIfThen:
Description: 'Do not use then for multi-line if/unless.'
StyleGuide: '#no-then'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.26'
Style/MultilineMemoization:
Description: 'Wrap multiline memoizations in a `begin` and `end` block.'
Enabled: true
VersionAdded: '0.44'
VersionChanged: '0.48'
EnforcedStyle: keyword
SupportedStyles:
- keyword
- braces
Style/MultilineMethodSignature:
Description: 'Avoid multi-line method signatures.'
Enabled: false
VersionAdded: '0.59'
Style/MultilineTernaryOperator:
Description: >-
Avoid multi-line ?: (the ternary operator);
use if/unless instead.
StyleGuide: '#no-multiline-ternary'
Enabled: true
VersionAdded: '0.9'
Style/MultipleComparison:
Description: >-
Avoid comparing a variable with multiple items in a conditional,
use Array#include? instead.
Enabled: true
VersionAdded: '0.49'
Style/MutableConstant:
Description: 'Do not assign mutable objects to constants.'
Enabled: true
VersionAdded: '0.34'
Style/NegatedIf:
Description: >-
Favor unless over if for negative conditions
(or control flow or).
StyleGuide: '#unless-for-negatives'
Enabled: true
VersionAdded: '0.20'
VersionChanged: '0.48'
EnforcedStyle: both
SupportedStyles:
# both: prefix and postfix negated `if` should both use `unless`
# prefix: only use `unless` for negated `if` statements positioned before the body of the statement
# postfix: only use `unless` for negated `if` statements positioned after the body of the statement
- both
- prefix
- postfix
Style/NegatedWhile:
Description: 'Favor until over while for negative conditions.'
StyleGuide: '#until-for-negatives'
Enabled: true
VersionAdded: '0.20'
Style/NestedModifier:
Description: 'Avoid using nested modifiers.'
StyleGuide: '#no-nested-modifiers'
Enabled: true
VersionAdded: '0.35'
Style/NestedParenthesizedCalls:
Description: >-
Parenthesize method calls which are nested inside the
argument list of another parenthesized method call.
Enabled: true
VersionAdded: '0.36'
VersionChanged: '0.50'
Whitelist:
- be
- be_a
- be_an
- be_between
- be_falsey
- be_kind_of
- be_instance_of
- be_truthy
- be_within
- eq
- eql
- end_with
- include
- match
- raise_error
- respond_to
- start_with
Style/NestedTernaryOperator:
Description: 'Use one expression per branch in a ternary operator.'
StyleGuide: '#no-nested-ternary'
Enabled: true
VersionAdded: '0.9'
Style/Next:
Description: 'Use `next` to skip iteration instead of a condition at the end.'
StyleGuide: '#no-nested-conditionals'
Enabled: true
VersionAdded: '0.22'
VersionChanged: '0.35'
# With `always` all conditions at the end of an iteration needs to be
# replaced by next - with `skip_modifier_ifs` the modifier if like this one
# are ignored: [1, 2].each { |a| return 'yes' if a == 1 }
EnforcedStyle: skip_modifier_ifs
# `MinBodyLength` defines the number of lines of the a body of an `if` or `unless`
# needs to have to trigger this cop
MinBodyLength: 3
SupportedStyles:
- skip_modifier_ifs
- always
Style/NilComparison:
Description: 'Prefer x.nil? to x == nil.'
StyleGuide: '#predicate-methods'
Enabled: true
VersionAdded: '0.12'
VersionChanged: '0.59'
EnforcedStyle: predicate
SupportedStyles:
- predicate
- comparison
Style/NonNilCheck:
Description: 'Checks for redundant nil checks.'
StyleGuide: '#no-non-nil-checks'
Enabled: true
VersionAdded: '0.20'
VersionChanged: '0.22'
# With `IncludeSemanticChanges` set to `true`, this cop reports offenses for
# `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which is
# **usually** OK, but might change behavior.
#
# With `IncludeSemanticChanges` set to `false`, this cop does not report
# offenses for `!x.nil?` and does no changes that might change behavior.
IncludeSemanticChanges: false
Style/Not:
Description: 'Use ! instead of not.'
StyleGuide: '#bang-not-not'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.20'
Style/NumericLiteralPrefix:
Description: 'Use smallcase prefixes for numeric literals.'
StyleGuide: '#numeric-literal-prefixes'
Enabled: true
VersionAdded: '0.41'
EnforcedOctalStyle: zero_with_o
SupportedOctalStyles:
- zero_with_o
- zero_only
Style/NumericLiterals:
Description: >-
Add underscores to large numeric literals to improve their
readability.
StyleGuide: '#underscores-in-numerics'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.48'
MinDigits: 5
Strict: false
Style/NumericPredicate:
Description: >-
Checks for the use of predicate- or comparison methods for
numeric comparisons.
StyleGuide: '#predicate-methods'
Safe: false
# This will change to a new method call which isn't guaranteed to be on the
# object. Switching these methods has to be done with knowledge of the types
# of the variables which rubocop doesn't have.
SafeAutoCorrect: false
AutoCorrect: false
Enabled: true
VersionAdded: '0.42'
VersionChanged: '0.59'
EnforcedStyle: predicate
SupportedStyles:
- predicate
- comparison
IgnoredMethods: []
# Exclude RSpec specs because assertions like `expect(1).to be > 0` cause
# false positives.
Exclude:
- 'spec/**/*'
Style/OneLineConditional:
Description: >-
Favor the ternary operator(?:) over
if/then/else/end constructs.
StyleGuide: '#ternary-operator'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.38'
Style/OptionHash:
Description: "Don't use option hashes when you can use keyword arguments."
Enabled: false
VersionAdded: '0.33'
VersionChanged: '0.34'
# A list of parameter names that will be flagged by this cop.
SuspiciousParamNames:
- options
- opts
- args
- params
- parameters
Style/OptionalArguments:
Description: >-
Checks for optional arguments that do not appear at the end
of the argument list
StyleGuide: '#optional-arguments'
Enabled: true
VersionAdded: '0.33'
Style/OrAssignment:
Description: 'Recommend usage of double pipe equals (||=) where applicable.'
StyleGuide: '#double-pipe-for-uninit'
Enabled: true
VersionAdded: '0.50'
Style/ParallelAssignment:
Description: >-
Check for simple usages of parallel assignment.
It will only warn when the number of variables
matches on both sides of the assignment.
StyleGuide: '#parallel-assignment'
Enabled: true
VersionAdded: '0.32'
Style/ParenthesesAroundCondition:
Description: >-
Don't use parentheses around the condition of an
if/unless/while.
StyleGuide: '#no-parens-around-condition'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.56'
AllowSafeAssignment: true
AllowInMultilineConditions: false
Style/PercentLiteralDelimiters:
Description: 'Use `%`-literal delimiters consistently'
StyleGuide: '#percent-literal-braces'
Enabled: true
VersionAdded: '0.19'
# Specify the default preferred delimiter for all types with the 'default' key
# Override individual delimiters (even with default specified) by specifying
# an individual key
PreferredDelimiters:
default: ()
'%i': '[]'
'%I': '[]'
'%r': '{}'
'%w': '[]'
'%W': '[]'
VersionChanged: '0.48.1'
Style/PercentQLiterals:
Description: 'Checks if uses of %Q/%q match the configured preference.'
Enabled: true
VersionAdded: '0.25'
EnforcedStyle: lower_case_q
SupportedStyles:
- lower_case_q # Use `%q` when possible, `%Q` when necessary
- upper_case_q # Always use `%Q`
Style/PerlBackrefs:
Description: 'Avoid Perl-style regex back references.'
StyleGuide: '#no-perl-regexp-last-matchers'
Enabled: true
VersionAdded: '0.13'
Style/PreferredHashMethods:
Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
StyleGuide: '#hash-key'
Enabled: true
VersionAdded: '0.41'
VersionChanged: '0.44'
EnforcedStyle: short
SupportedStyles:
- short
- verbose
Style/Proc:
Description: 'Use proc instead of Proc.new.'
StyleGuide: '#proc'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.18'
Style/RaiseArgs:
Description: 'Checks the arguments passed to raise/fail.'
StyleGuide: '#exception-class-messages'
Enabled: true
VersionAdded: '0.14'
VersionChanged: '0.40'
EnforcedStyle: exploded
SupportedStyles:
- compact # raise Exception.new(msg)
- exploded # raise Exception, msg
Style/RandomWithOffset:
Description: >-
Prefer to use ranges when generating random numbers instead of
integers with offsets.
StyleGuide: '#random-numbers'
Enabled: true
VersionAdded: '0.52'
Style/RedundantBegin:
Description: "Don't use begin blocks when they are not needed."
StyleGuide: '#begin-implicit'
Enabled: true
VersionAdded: '0.10'
VersionChanged: '0.21'
Style/RedundantConditional:
Description: "Don't return true/false from a conditional."
Enabled: true
VersionAdded: '0.50'
Style/RedundantException:
Description: "Checks for an obsolete RuntimeException argument in raise/fail."
StyleGuide: '#no-explicit-runtimeerror'
Enabled: true
VersionAdded: '0.14'
VersionChanged: '0.29'
Style/RedundantFreeze:
Description: "Checks usages of Object#freeze on immutable objects."
Enabled: true
VersionAdded: '0.34'
Style/RedundantParentheses:
Description: "Checks for parentheses that seem not to serve any purpose."
Enabled: true
VersionAdded: '0.36'
Style/RedundantReturn:
Description: "Don't use return where it's not required."
StyleGuide: '#no-explicit-return'
Enabled: true
VersionAdded: '0.10'
VersionChanged: '0.14'
# When `true` allows code like `return x, y`.
AllowMultipleReturnValues: false
Style/RedundantSelf:
Description: "Don't use self where it's not needed."
StyleGuide: '#no-self-unless-required'
Enabled: true
VersionAdded: '0.10'
VersionChanged: '0.13'
Style/RegexpLiteral:
Description: 'Use / or %r around regular expressions.'
StyleGuide: '#percent-r'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.30'
EnforcedStyle: slashes
# slashes: Always use slashes.
# percent_r: Always use `%r`.
# mixed: Use slashes on single-line regexes, and `%r` on multi-line regexes.
SupportedStyles:
- slashes
- percent_r
- mixed
# If `false`, the cop will always recommend using `%r` if one or more slashes
# are found in the regexp string.
AllowInnerSlashes: false
Style/RescueModifier:
Description: 'Avoid using rescue in its modifier form.'
StyleGuide: '#no-rescue-modifiers'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.34'
Style/RescueStandardError:
Description: 'Avoid rescuing without specifying an error class.'
Enabled: true
VersionAdded: '0.52'
EnforcedStyle: explicit
# implicit: Do not include the error class, `rescue`
# explicit: Require an error class `rescue StandardError`
SupportedStyles:
- implicit
- explicit
Style/ReturnNil:
Description: 'Use return instead of return nil.'
Enabled: false
EnforcedStyle: return
SupportedStyles:
- return
- return_nil
VersionAdded: '0.50'
Style/SafeNavigation:
Description: >-
This cop transforms usages of a method call safeguarded by
a check for the existence of the object to
safe navigation (`&.`).
Enabled: true
VersionAdded: '0.43'
VersionChanged: '0.44'
# Safe navigation may cause a statement to start returning `nil` in addition
# to whatever it used to return.
ConvertCodeThatCanStartToReturnNil: false
Whitelist:
- present?
- blank?
- presence
- try
- try!
VersionChanged: '0.56'
Style/SelfAssignment:
Description: >-
Checks for places where self-assignment shorthand should have
been used.
StyleGuide: '#self-assignment'
Enabled: true
VersionAdded: '0.19'
VersionChanged: '0.29'
Style/Semicolon:
Description: "Don't use semicolons to terminate expressions."
StyleGuide: '#no-semicolon'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.19'
# Allow `;` to separate several expressions on the same line.
AllowAsExpressionSeparator: false
Style/Send:
Description: 'Prefer `Object#__send__` or `Object#public_send` to `send`, as `send` may overlap with existing methods.'
StyleGuide: '#prefer-public-send'
Enabled: false
VersionAdded: '0.33'
Style/SignalException:
Description: 'Checks for proper usage of fail and raise.'
StyleGuide: '#prefer-raise-over-fail'
Enabled: true
VersionAdded: '0.11'
VersionChanged: '0.37'
EnforcedStyle: only_raise
SupportedStyles:
- only_raise
- only_fail
- semantic
Style/SingleLineBlockParams:
Description: 'Enforces the names of some block params.'
Enabled: false
VersionAdded: '0.16'
VersionChanged: '0.47'
Methods:
- reduce:
- acc
- elem
- inject:
- acc
- elem
Style/SingleLineMethods:
Description: 'Avoid single-line methods.'
StyleGuide: '#no-single-line-methods'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.19'
AllowIfMethodIsEmpty: true
Style/SpecialGlobalVars:
Description: 'Avoid Perl-style global variables.'
StyleGuide: '#no-cryptic-perlisms'
Enabled: true
VersionAdded: '0.13'
VersionChanged: '0.36'
SafeAutoCorrect: false
EnforcedStyle: use_english_names
SupportedStyles:
- use_perl_names
- use_english_names
Style/StabbyLambdaParentheses:
Description: 'Check for the usage of parentheses around stabby lambda arguments.'
StyleGuide: '#stabby-lambda-with-args'
Enabled: true
VersionAdded: '0.35'
EnforcedStyle: require_parentheses
SupportedStyles:
- require_parentheses
- require_no_parentheses
Style/StderrPuts:
Description: 'Use `warn` instead of `$stderr.puts`.'
StyleGuide: '#warn'
Enabled: true
VersionAdded: '0.51'
Style/StringHashKeys:
Description: 'Prefer symbols instead of strings as hash keys.'
StyleGuide: '#symbols-as-keys'
Enabled: false
VersionAdded: '0.52'
Style/StringLiterals:
Description: 'Checks if uses of quotes match the configured preference.'
StyleGuide: '#consistent-string-literals'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.36'
EnforcedStyle: single_quotes
SupportedStyles:
- single_quotes
- double_quotes
# If `true`, strings which span multiple lines using `\` for continuation must
# use the same type of quotes on each line.
ConsistentQuotesInMultiline: false
Style/StringLiteralsInInterpolation:
Description: >-
Checks if uses of quotes inside expressions in interpolated
strings match the configured preference.
Enabled: true
VersionAdded: '0.27'
EnforcedStyle: single_quotes
SupportedStyles:
- single_quotes
- double_quotes
Style/StringMethods:
Description: 'Checks if configured preferred methods are used over non-preferred.'
Enabled: false
VersionAdded: '0.34'
VersionChanged: '0.34.2'
# Mapping from undesired method to desired_method
# e.g. to use `to_sym` over `intern`:
#
# StringMethods:
# PreferredMethods:
# intern: to_sym
PreferredMethods:
intern: to_sym
Style/StructInheritance:
Description: 'Checks for inheritance from Struct.new.'
StyleGuide: '#no-extend-struct-new'
Enabled: true
VersionAdded: '0.29'
Style/SymbolArray:
Description: 'Use %i or %I for arrays of symbols.'
StyleGuide: '#percent-i'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.49'
EnforcedStyle: percent
MinSize: 2
SupportedStyles:
- percent
- brackets
Style/SymbolLiteral:
Description: 'Use plain symbols instead of string symbols when possible.'
Enabled: true
VersionAdded: '0.30'
Style/SymbolProc:
Description: 'Use symbols as procs instead of blocks when possible.'
Enabled: true
VersionAdded: '0.26'
VersionChanged: '0.40'
# A list of method names to be ignored by the check.
# The names should be fairly unique, otherwise you'll end up ignoring lots of code.
IgnoredMethods:
- respond_to
- define_method
Style/TernaryParentheses:
Description: 'Checks for use of parentheses around ternary conditions.'
Enabled: true
VersionAdded: '0.42'
VersionChanged: '0.46'
EnforcedStyle: require_no_parentheses
SupportedStyles:
- require_parentheses
- require_no_parentheses
- require_parentheses_when_complex
AllowSafeAssignment: true
Style/TrailingBodyOnClass:
Description: 'Class body goes below class statement.'
Enabled: true
VersionAdded: '0.53'
Style/TrailingBodyOnMethodDefinition:
Description: 'Method body goes below definition.'
Enabled: true
VersionAdded: '0.52'
Style/TrailingBodyOnModule:
Description: 'Module body goes below module statement.'
Enabled: true
VersionAdded: '0.53'
Style/TrailingCommaInArguments:
Description: 'Checks for trailing comma in argument lists.'
StyleGuide: '#no-trailing-params-comma'
Enabled: true
VersionAdded: '0.36'
# If `comma`, the cop requires a comma after the last argument, but only for
# parenthesized method calls where each argument is on its own line.
# If `consistent_comma`, the cop requires a comma after the last argument,
# for all parenthesized method calls with arguments.
EnforcedStyleForMultiline: no_comma
SupportedStylesForMultiline:
- comma
- consistent_comma
- no_comma
Style/TrailingCommaInArrayLiteral:
Description: 'Checks for trailing comma in array literals.'
StyleGuide: '#no-trailing-array-commas'
Enabled: true
VersionAdded: '0.53'
# but only when each item is on its own line.
# If `consistent_comma`, the cop requires a comma after the last item of all
# non-empty array literals.
EnforcedStyleForMultiline: no_comma
SupportedStylesForMultiline:
- comma
- consistent_comma
- no_comma
Style/TrailingCommaInHashLiteral:
Description: 'Checks for trailing comma in hash literals.'
Enabled: true
# If `comma`, the cop requires a comma after the last item in a hash,
# but only when each item is on its own line.
# If `consistent_comma`, the cop requires a comma after the last item of all
# non-empty hash literals.
EnforcedStyleForMultiline: no_comma
SupportedStylesForMultiline:
- comma
- consistent_comma
- no_comma
VersionAdded: '0.53'
Style/TrailingMethodEndStatement:
Description: 'Checks for trailing end statement on line of method body.'
Enabled: true
VersionAdded: '0.52'
Style/TrailingUnderscoreVariable:
Description: >-
Checks for the usage of unneeded trailing underscores at the
end of parallel variable assignment.
AllowNamedUnderscoreVariables: true
Enabled: true
VersionAdded: '0.31'
VersionChanged: '0.35'
# `TrivialAccessors` requires exact name matches and doesn't allow
# predicated methods by default.
Style/TrivialAccessors:
Description: 'Prefer attr_* methods to trivial readers/writers.'
StyleGuide: '#attr_family'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.38'
# When set to `false` the cop will suggest the use of accessor methods
# in situations like:
#
# def name
# @other_name
# end
#
# This way you can uncover "hidden" attributes in your code.
ExactNameMatch: true
AllowPredicates: true
# Allows trivial writers that don't end in an equal sign. e.g.
#
# def on_exception(action)
# @on_exception=action
# end
# on_exception :restart
#
# Commonly used in DSLs
AllowDSLWriters: false
IgnoreClassMethods: false
Whitelist:
- to_ary
- to_a
- to_c
- to_enum
- to_h
- to_hash
- to_i
- to_int
- to_io
- to_open
- to_path
- to_proc
- to_r
- to_regexp
- to_str
- to_s
- to_sym
Style/UnlessElse:
Description: >-
Do not use unless with else. Rewrite these with the positive
case first.
StyleGuide: '#no-else-with-unless'
Enabled: true
VersionAdded: '0.9'
Style/UnneededCapitalW:
Description: 'Checks for %W when interpolation is not needed.'
Enabled: true
VersionAdded: '0.21'
VersionChanged: '0.24'
Style/UnneededCondition:
Description: 'Checks for unnecessary conditional expressions.'
Enabled: true
VersionAdded: '0.57'
Style/UnneededInterpolation:
Description: 'Checks for strings that are just an interpolated expression.'
Enabled: true
VersionAdded: '0.36'
Style/UnneededPercentQ:
Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
StyleGuide: '#percent-q'
Enabled: true
VersionAdded: '0.24'
Style/UnpackFirst:
Description: >-
Checks for accessing the first element of `String#unpack`
instead of using `unpack1`
Enabled: true
VersionAdded: '0.54'
Style/VariableInterpolation:
Description: >-
Don't interpolate global, instance and class variables
directly in strings.
StyleGuide: '#curlies-interpolate'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.20'
Style/WhenThen:
Description: 'Use when x then ... for one-line cases.'
StyleGuide: '#one-line-cases'
Enabled: true
VersionAdded: '0.9'
Style/WhileUntilDo:
Description: 'Checks for redundant do after while or until.'
StyleGuide: '#no-multiline-while-do'
Enabled: true
VersionAdded: '0.9'
Style/WhileUntilModifier:
Description: >-
Favor modifier while/until usage when you have a
single-line body.
StyleGuide: '#while-as-a-modifier'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.30'
Style/WordArray:
Description: 'Use %w or %W for arrays of words.'
StyleGuide: '#percent-w'
Enabled: true
VersionAdded: '0.9'
VersionChanged: '0.36'
EnforcedStyle: percent
SupportedStyles:
# percent style: %w(word1 word2)
- percent
# bracket style: ['word1', 'word2']
- brackets
# The `MinSize` option causes the `WordArray` rule to be ignored for arrays
# smaller than a certain size. The rule is only applied to arrays
# whose element count is greater than or equal to `MinSize`.
MinSize: 2
# The regular expression `WordRegex` decides what is considered a word.
WordRegex: !ruby/regexp '/\A[\p{Word}\n\t]+\z/'
Style/YodaCondition:
Description: 'Do not use literals as the first operand of a comparison.'
Reference: 'https://en.wikipedia.org/wiki/Yoda_conditions'
Enabled: true
EnforcedStyle: all_comparison_operators
SupportedStyles:
# check all comparison operators
- all_comparison_operators
# check only equality operators: `!=` and `==`
- equality_operators_only
VersionAdded: '0.49'
VersionChanged: '0.50'
Style/ZeroLengthPredicate:
Description: 'Use #empty? when testing for objects of length 0.'
Enabled: true
Safe: false
VersionAdded: '0.37'
VersionChanged: '0.39'
{
"rules": {
"at-rule-empty-line-before": [ "always", {
"except": [
"blockless-after-same-name-blockless",
"first-nested"
],
"ignore": ["after-comment"]
} ],
"at-rule-name-case": "lower",
"at-rule-name-space-after": "always-single-line",
"at-rule-semicolon-newline-after": "always",
"block-closing-brace-empty-line-before": "never",
"block-closing-brace-newline-after": "always",
"block-closing-brace-newline-before": "always-multi-line",
"block-closing-brace-space-before": "always-single-line",
"block-opening-brace-newline-after": "always-multi-line",
"block-opening-brace-space-after": "always-single-line",
"block-opening-brace-space-before": "always",
"color-hex-case": "lower",
"color-hex-length": "short",
"comment-empty-line-before": [ "always", {
"except": ["first-nested"],
"ignore": ["stylelint-commands"]
} ],
"comment-whitespace-inside": "always",
"custom-property-empty-line-before": [ "always", {
"except": [
"after-custom-property",
"first-nested"
],
"ignore": [
"after-comment",
"inside-single-line-block"
]
} ],
"declaration-bang-space-after": "never",
"declaration-bang-space-before": "always",
"declaration-block-semicolon-newline-after": "always-multi-line",
"declaration-block-semicolon-space-after": "always-single-line",
"declaration-block-semicolon-space-before": "never",
"declaration-block-single-line-max-declarations": 1,
"declaration-block-trailing-semicolon": "always",
"declaration-colon-newline-after": "always-multi-line",
"declaration-colon-space-after": "always-single-line",
"declaration-colon-space-before": "never",
"declaration-empty-line-before": [ "always", {
"except": [
"after-declaration",
"first-nested"
],
"ignore": [
"after-comment",
"inside-single-line-block"
]
} ],
"function-comma-newline-after": "always-multi-line",
"function-comma-space-after": "always-single-line",
"function-comma-space-before": "never",
"function-max-empty-lines": 0,
"function-name-case": "lower",
"function-parentheses-newline-inside": "always-multi-line",
"function-parentheses-space-inside": "never-single-line",
"function-whitespace-after": "always",
"indentation": 4,
"length-zero-no-unit": true,
"max-empty-lines": 1,
"media-feature-colon-space-after": "always",
"media-feature-colon-space-before": "never",
"media-feature-name-case": "lower",
"media-feature-parentheses-space-inside": "never",
"media-feature-range-operator-space-after": "always",
"media-feature-range-operator-space-before": "always",
"media-query-list-comma-newline-after": "always-multi-line",
"media-query-list-comma-space-after": "always-single-line",
"media-query-list-comma-space-before": "never",
"no-eol-whitespace": true,
"no-missing-end-of-source-newline": true,
"number-leading-zero": "always",
"number-no-trailing-zeros": true,
"property-case": "lower",
"rule-empty-line-before": [ "always-multi-line", {
"except": ["first-nested"],
"ignore": ["after-comment"]
} ],
"selector-attribute-brackets-space-inside": "never",
"selector-attribute-operator-space-after": "never",
"selector-attribute-operator-space-before": "never",
"selector-combinator-space-after": "always",
"selector-combinator-space-before": "always",
"selector-descendant-combinator-no-non-space": true,
"selector-list-comma-newline-after": "always",
"selector-list-comma-space-before": "never",
"selector-max-empty-lines": 0,
"selector-pseudo-class-case": "lower",
"selector-pseudo-class-parentheses-space-inside": "never",
"selector-pseudo-element-case": "lower",
"selector-pseudo-element-colon-notation": "double",
"selector-type-case": "lower",
"unit-case": "lower",
"value-list-comma-newline-after": "always-multi-line",
"value-list-comma-space-after": "always-single-line",
"value-list-comma-space-before": "never",
"value-list-max-empty-lines": 0
}
}
{
"parse": {
"bare_returns": false,
"ecma": 8,
"expression": false,
"filename": null,
"html5_comments": true,
"module": false,
"shebang": true,
"strict": false,
"toplevel": null
},
"compress": {
"arguments": false,
"arrows": true,
"booleans": true,
"booleans_as_integers": false,
"collapse_vars": true,
"comparisons": true,
"computed_props": true,
"conditionals": true,
"dead_code": true,
"defaults": true,
"directives": true,
"drop_console": false,
"drop_debugger": true,
"ecma": 5,
"evaluate": true,
"expression": false,
"global_defs": false,
"hoist_funs": false,
"hoist_props": true,
"hoist_vars": false,
"ie8": false,
"if_return": true,
"inline": true,
"join_vars": true,
"keep_classnames": false,
"keep_fargs": true,
"keep_fnames": false,
"keep_infinity": false,
"loops": true,
"module": false,
"negate_iife": true,
"passes": 1,
"properties": true,
"pure_getters": "strict",
"pure_funcs": null,
"reduce_funcs": true,
"reduce_vars": true,
"sequences": true,
"side_effects": true,
"switches": true,
"top_retain": null,
"toplevel": false,
"typeofs": true,
"unsafe": false,
"unsafe_arrows": false,
"unsafe_comps": false,
"unsafe_Function": false,
"unsafe_math": false,
"unsafe_methods": false,
"unsafe_proto": false,
"unsafe_regexp": false,
"unsafe_undefined": false,
"unused": true,
"warnings": false
},
"mangle": {
"cache": true,
"eval": false,
"ie8": false,
"keep_classnames": false,
"keep_fnames": false,
"module": false,
"properties": false,
"reserved": [],
"safari10": false,
"toplevel": false
},
"output": {
"ascii_only": false,
"beautify": false,
"braces": false,
"comments": false,
"ecma": 5,
"ie8": false,
"indent_level": 4,
"indent_start": 0,
"inline_script": true,
"keep_quoted_props": false,
"max_line_len": false,
"preamble": null,
"quote_keys": false,
"quote_style": 1,
"safari10": false,
"semicolons": true,
"shebang": true,
"shorthand": false,
"source_map": null,
"webkit": false,
"width": 80,
"wrap_iife": false
}
}
# Uncrustify-0.68
#
# General options
#
# The type of line endings.
#
# Default: auto
newlines = auto # lf/crlf/cr/auto
# The original size of tabs in the input.
#
# Default: 8
input_tab_size = 8 # unsigned number
# The size of tabs in the output (only used if align_with_tabs=true).
#
# Default: 8
output_tab_size = 8 # unsigned number
# The ASCII value of the string escape char, usually 92 (\) or (Pawn) 94 (^).
#
# Default: 92
string_escape_char = 92 # unsigned number
# Alternate string escape char (usually only used for Pawn).
# Only works right before the quote char.
string_escape_char2 = 0 # unsigned number
# Replace tab characters found in string literals with the escape sequence \t
# instead.
string_replace_tab_chars = false # true/false
# Allow interpreting '>=' and '>>=' as part of a template in code like
# 'void f(list<list<B>>=val);'. If true, 'assert(x<0 && y>=3)' will be broken.
# Improvements to template detection may make this option obsolete.
tok_split_gte = false # true/false
# Specify the marker used in comments to disable processing of part of the
# file.
#
# Default: *INDENT-OFF*
disable_processing_cmt = " *INDENT-OFF*" # string
# Specify the marker used in comments to (re)enable processing in a file.
#
# Default: *INDENT-ON*
enable_processing_cmt = " *INDENT-ON*" # string
# Enable parsing of digraphs.
enable_digraphs = false # true/false
# Add or remove the UTF-8 BOM (recommend 'remove').
utf8_bom = ignore # ignore/add/remove/force
# If the file contains bytes with values between 128 and 255, but is not
# UTF-8, then output as UTF-8.
utf8_byte = false # true/false
# Force the output encoding to UTF-8.
utf8_force = false # true/false
#
# Spacing options
#
# Add or remove space around non-assignment symbolic operators ('+', '/', '%',
# '<<', and so forth).
sp_arith = ignore # ignore/add/remove/force
# Add or remove space around arithmetic operators '+' and '-'.
#
# Overrides sp_arith.
sp_arith_additive = ignore # ignore/add/remove/force
# Add or remove space around assignment operator '=', '+=', etc.
sp_assign = ignore # ignore/add/remove/force
# Add or remove space around '=' in C++11 lambda capture specifications.
#
# Overrides sp_assign.
sp_cpp_lambda_assign = ignore # ignore/add/remove/force
# Add or remove space after the capture specification in C++11 lambda.
sp_cpp_lambda_paren = ignore # ignore/add/remove/force
# Add or remove space around assignment operator '=' in a prototype.
sp_assign_default = ignore # ignore/add/remove/force
# Add or remove space before assignment operator '=', '+=', etc.
#
# Overrides sp_assign.
sp_before_assign = ignore # ignore/add/remove/force
# Add or remove space after assignment operator '=', '+=', etc.
#
# Overrides sp_assign.
sp_after_assign = ignore # ignore/add/remove/force
# Add or remove space in 'NS_ENUM ('.
sp_enum_paren = ignore # ignore/add/remove/force
# Add or remove space around assignment '=' in enum.
sp_enum_assign = ignore # ignore/add/remove/force
# Add or remove space before assignment '=' in enum.
#
# Overrides sp_enum_assign.
sp_enum_before_assign = ignore # ignore/add/remove/force
# Add or remove space after assignment '=' in enum.
#
# Overrides sp_enum_assign.
sp_enum_after_assign = ignore # ignore/add/remove/force
# Add or remove space around assignment ':' in enum.
sp_enum_colon = ignore # ignore/add/remove/force
# Add or remove space around preprocessor '##' concatenation operator.
#
# Default: add
sp_pp_concat = add # ignore/add/remove/force
# Add or remove space after preprocessor '#' stringify operator.
# Also affects the '#@' charizing operator.
sp_pp_stringify = ignore # ignore/add/remove/force
# Add or remove space before preprocessor '#' stringify operator
# as in '#define x(y) L#y'.
sp_before_pp_stringify = ignore # ignore/add/remove/force
# Add or remove space around boolean operators '&&' and '||'.
sp_bool = ignore # ignore/add/remove/force
# Add or remove space around compare operator '<', '>', '==', etc.
sp_compare = ignore # ignore/add/remove/force
# Add or remove space inside '(' and ')'.
sp_inside_paren = ignore # ignore/add/remove/force
# Add or remove space between nested parentheses, i.e. '((' vs. ') )'.
sp_paren_paren = ignore # ignore/add/remove/force
# Add or remove space between back-to-back parentheses, i.e. ')(' vs. ') ('.
sp_cparen_oparen = ignore # ignore/add/remove/force
# Whether to balance spaces inside nested parentheses.
sp_balance_nested_parens = false # true/false
# Add or remove space between ')' and '{'.
sp_paren_brace = ignore # ignore/add/remove/force
# Add or remove space between nested braces, i.e. '{{' vs '{ {'.
sp_brace_brace = ignore # ignore/add/remove/force
# Add or remove space before pointer star '*'.
sp_before_ptr_star = ignore # ignore/add/remove/force
# Add or remove space before pointer star '*' that isn't followed by a
# variable name. If set to 'ignore', sp_before_ptr_star is used instead.
sp_before_unnamed_ptr_star = ignore # ignore/add/remove/force
# Add or remove space between pointer stars '*'.
sp_between_ptr_star = ignore # ignore/add/remove/force
# Add or remove space after pointer star '*', if followed by a word.
sp_after_ptr_star = ignore # ignore/add/remove/force
# Add or remove space after pointer caret '^', if followed by a word.
sp_after_ptr_block_caret = ignore # ignore/add/remove/force
# Add or remove space after pointer star '*', if followed by a qualifier.
sp_after_ptr_star_qualifier = ignore # ignore/add/remove/force
# Add or remove space after a pointer star '*', if followed by a function
# prototype or function definition.
sp_after_ptr_star_func = ignore # ignore/add/remove/force
# Add or remove space after a pointer star '*', if followed by an open
# parenthesis, as in 'void* (*)().
sp_ptr_star_paren = ignore # ignore/add/remove/force
# Add or remove space before a pointer star '*', if followed by a function
# prototype or function definition.
sp_before_ptr_star_func = ignore # ignore/add/remove/force
# Add or remove space before a reference sign '&'.
sp_before_byref = ignore # ignore/add/remove/force
# Add or remove space before a reference sign '&' that isn't followed by a
# variable name. If set to 'ignore', sp_before_byref is used instead.
sp_before_unnamed_byref = ignore # ignore/add/remove/force
# Add or remove space after reference sign '&', if followed by a word.
sp_after_byref = ignore # ignore/add/remove/force
# Add or remove space after a reference sign '&', if followed by a function
# prototype or function definition.
sp_after_byref_func = ignore # ignore/add/remove/force
# Add or remove space before a reference sign '&', if followed by a function
# prototype or function definition.
sp_before_byref_func = ignore # ignore/add/remove/force
# Add or remove space between type and word.
#
# Default: force
sp_after_type = force # ignore/add/remove/force
# Add or remove space between 'decltype(...)' and word.
sp_after_decltype = ignore # ignore/add/remove/force
# (D) Add or remove space before the parenthesis in the D constructs
# 'template Foo(' and 'class Foo('.
sp_before_template_paren = ignore # ignore/add/remove/force
# Add or remove space between 'template' and '<'.
# If set to ignore, sp_before_angle is used.
sp_template_angle = ignore # ignore/add/remove/force
# Add or remove space before '<'.
sp_before_angle = ignore # ignore/add/remove/force
# Add or remove space inside '<' and '>'.
sp_inside_angle = ignore # ignore/add/remove/force
# Add or remove space between '>' and ':'.
sp_angle_colon = ignore # ignore/add/remove/force
# Add or remove space after '<>'.
sp_after_angle = ignore # ignore/add/remove/force
# Add or remove space between '>' and '(' as found in 'new List<byte>(foo);'.
sp_angle_paren = ignore # ignore/add/remove/force
# Add or remove space between '>' and '()' as found in 'new List<byte>();'.
sp_angle_paren_empty = ignore # ignore/add/remove/force
# Add or remove space between '>' and a word as in 'List<byte> m;' or
# 'template <typename T> static ...'.
sp_angle_word = ignore # ignore/add/remove/force
# Add or remove space between '>' and '>' in '>>' (template stuff).
#
# Default: add
sp_angle_shift = add # ignore/add/remove/force
# (C++11) Permit removal of the space between '>>' in 'foo<bar<int> >'. Note
# that sp_angle_shift cannot remove the space without this option.
sp_permit_cpp11_shift = false # true/false
# Add or remove space before '(' of control statements ('if', 'for', 'switch',
# 'while', etc.).
sp_before_sparen = ignore # ignore/add/remove/force
# Add or remove space inside '(' and ')' of control statements.
sp_inside_sparen = ignore # ignore/add/remove/force
# Add or remove space after '(' of control statements.
#
# Overrides sp_inside_sparen.
sp_inside_sparen_open = ignore # ignore/add/remove/force
# Add or remove space before ')' of control statements.
#
# Overrides sp_inside_sparen.
sp_inside_sparen_close = ignore # ignore/add/remove/force
# Add or remove space after ')' of control statements.
sp_after_sparen = ignore # ignore/add/remove/force
# Add or remove space between ')' and '{' of of control statements.
sp_sparen_brace = ignore # ignore/add/remove/force
# (D) Add or remove space between 'invariant' and '('.
sp_invariant_paren = ignore # ignore/add/remove/force
# (D) Add or remove space after the ')' in 'invariant (C) c'.
sp_after_invariant_paren = ignore # ignore/add/remove/force
# Add or remove space before empty statement ';' on 'if', 'for' and 'while'.
sp_special_semi = ignore # ignore/add/remove/force
# Add or remove space before ';'.
#
# Default: remove
sp_before_semi = remove # ignore/add/remove/force
# Add or remove space before ';' in non-empty 'for' statements.
sp_before_semi_for = ignore # ignore/add/remove/force
# Add or remove space before a semicolon of an empty part of a for statement.
sp_before_semi_for_empty = ignore # ignore/add/remove/force
# Add or remove space after ';', except when followed by a comment.
#
# Default: add
sp_after_semi = add # ignore/add/remove/force
# Add or remove space after ';' in non-empty 'for' statements.
#
# Default: force
sp_after_semi_for = force # ignore/add/remove/force
# Add or remove space after the final semicolon of an empty part of a for
# statement, as in 'for ( ; ; <here> )'.
sp_after_semi_for_empty = ignore # ignore/add/remove/force
# Add or remove space before '[' (except '[]').
sp_before_square = ignore # ignore/add/remove/force
# Add or remove space before '[]'.
sp_before_squares = ignore # ignore/add/remove/force
# Add or remove space before C++17 structured bindings.
sp_cpp_before_struct_binding = ignore # ignore/add/remove/force
# Add or remove space inside a non-empty '[' and ']'.
sp_inside_square = ignore # ignore/add/remove/force
# (OC) Add or remove space inside a non-empty Objective-C boxed array '@[' and
# ']'. If set to ignore, sp_inside_square is used.
sp_inside_square_oc_array = ignore # ignore/add/remove/force
# Add or remove space after ',', i.e. 'a,b' vs. 'a, b'.
sp_after_comma = ignore # ignore/add/remove/force
# Add or remove space before ','.
#
# Default: remove
sp_before_comma = remove # ignore/add/remove/force
# (C#) Add or remove space between ',' and ']' in multidimensional array type
# like 'int[,,]'.
sp_after_mdatype_commas = ignore # ignore/add/remove/force
# (C#) Add or remove space between '[' and ',' in multidimensional array type
# like 'int[,,]'.
sp_before_mdatype_commas = ignore # ignore/add/remove/force
# (C#) Add or remove space between ',' in multidimensional array type
# like 'int[,,]'.
sp_between_mdatype_commas = ignore # ignore/add/remove/force
# Add or remove space between an open parenthesis and comma,
# i.e. '(,' vs. '( ,'.
#
# Default: force
sp_paren_comma = force # ignore/add/remove/force
# Add or remove space before the variadic '...' when preceded by a
# non-punctuator.
sp_before_ellipsis = ignore # ignore/add/remove/force
# Add or remove space between a type and '...'.
sp_type_ellipsis = ignore # ignore/add/remove/force
# Add or remove space between ')' and '...'.
sp_paren_ellipsis = ignore # ignore/add/remove/force
# Add or remove space after class ':'.
sp_after_class_colon = ignore # ignore/add/remove/force
# Add or remove space before class ':'.
sp_before_class_colon = ignore # ignore/add/remove/force
# Add or remove space after class constructor ':'.
sp_after_constr_colon = ignore # ignore/add/remove/force
# Add or remove space before class constructor ':'.
sp_before_constr_colon = ignore # ignore/add/remove/force
# Add or remove space before case ':'.
#
# Default: remove
sp_before_case_colon = remove # ignore/add/remove/force
# Add or remove space between 'operator' and operator sign.
sp_after_operator = ignore # ignore/add/remove/force
# Add or remove space between the operator symbol and the open parenthesis, as
# in 'operator ++('.
sp_after_operator_sym = ignore # ignore/add/remove/force
# Overrides sp_after_operator_sym when the operator has no arguments, as in
# 'operator *()'.
sp_after_operator_sym_empty = ignore # ignore/add/remove/force
# Add or remove space after C/D cast, i.e. 'cast(int)a' vs. 'cast(int) a' or
# '(int)a' vs. '(int) a'.
sp_after_cast = ignore # ignore/add/remove/force
# Add or remove spaces inside cast parentheses.
sp_inside_paren_cast = ignore # ignore/add/remove/force
# Add or remove space between the type and open parenthesis in a C++ cast,
# i.e. 'int(exp)' vs. 'int (exp)'.
sp_cpp_cast_paren = ignore # ignore/add/remove/force
# Add or remove space between 'sizeof' and '('.
sp_sizeof_paren = ignore # ignore/add/remove/force
# Add or remove space between 'sizeof' and '...'.
sp_sizeof_ellipsis = ignore # ignore/add/remove/force
# Add or remove space between 'sizeof...' and '('.
sp_sizeof_ellipsis_paren = ignore # ignore/add/remove/force
# Add or remove space between 'decltype' and '('.
sp_decltype_paren = ignore # ignore/add/remove/force
# (Pawn) Add or remove space after the tag keyword.
sp_after_tag = ignore # ignore/add/remove/force
# Add or remove space inside enum '{' and '}'.
sp_inside_braces_enum = ignore # ignore/add/remove/force
# Add or remove space inside struct/union '{' and '}'.
sp_inside_braces_struct = ignore # ignore/add/remove/force
# (OC) Add or remove space inside Objective-C boxed dictionary '{' and '}'
sp_inside_braces_oc_dict = ignore # ignore/add/remove/force
# Add or remove space after open brace in an unnamed temporary
# direct-list-initialization.
sp_after_type_brace_init_lst_open = ignore # ignore/add/remove/force
# Add or remove space before close brace in an unnamed temporary
# direct-list-initialization.
sp_before_type_brace_init_lst_close = ignore # ignore/add/remove/force
# Add or remove space inside an unnamed temporary direct-list-initialization.
sp_inside_type_brace_init_lst = ignore # ignore/add/remove/force
# Add or remove space inside '{' and '}'.
sp_inside_braces = ignore # ignore/add/remove/force
# Add or remove space inside '{}'.
sp_inside_braces_empty = ignore # ignore/add/remove/force
# Add or remove space between return type and function name. A minimum of 1
# is forced except for pointer return types.
sp_type_func = ignore # ignore/add/remove/force
# Add or remove space between type and open brace of an unnamed temporary
# direct-list-initialization.
sp_type_brace_init_lst = ignore # ignore/add/remove/force
# Add or remove space between function name and '(' on function declaration.
sp_func_proto_paren = ignore # ignore/add/remove/force
# Add or remove space between function name and '()' on function declaration
# without parameters.
sp_func_proto_paren_empty = ignore # ignore/add/remove/force
# Add or remove space between function name and '(' on function definition.
sp_func_def_paren = ignore # ignore/add/remove/force
# Add or remove space between function name and '()' on function definition
# without parameters.
sp_func_def_paren_empty = ignore # ignore/add/remove/force
# Add or remove space inside empty function '()'.
sp_inside_fparens = ignore # ignore/add/remove/force
# Add or remove space inside function '(' and ')'.
sp_inside_fparen = ignore # ignore/add/remove/force
# Add or remove space inside the first parentheses in a function type, as in
# 'void (*x)(...)'.
sp_inside_tparen = ignore # ignore/add/remove/force
# Add or remove space between the ')' and '(' in a function type, as in
# 'void (*x)(...)'.
sp_after_tparen_close = ignore # ignore/add/remove/force
# Add or remove space between ']' and '(' when part of a function call.
sp_square_fparen = ignore # ignore/add/remove/force
# Add or remove space between ')' and '{' of function.
sp_fparen_brace = ignore # ignore/add/remove/force
# Add or remove space between ')' and '{' of s function call in object
# initialization.
#
# Overrides sp_fparen_brace.
sp_fparen_brace_initializer = ignore # ignore/add/remove/force
# (Java) Add or remove space between ')' and '{{' of double brace initializer.
sp_fparen_dbrace = ignore # ignore/add/remove/force
# Add or remove space between function name and '(' on function calls.
sp_func_call_paren = ignore # ignore/add/remove/force
# Add or remove space between function name and '()' on function calls without
# parameters. If set to 'ignore' (the default), sp_func_call_paren is used.
sp_func_call_paren_empty = ignore # ignore/add/remove/force
# Add or remove space between the user function name and '(' on function
# calls. You need to set a keyword to be a user function in the config file,
# like:
# set func_call_user tr _ i18n
sp_func_call_user_paren = ignore # ignore/add/remove/force
# Add or remove space inside user function '(' and ')'.
sp_func_call_user_inside_fparen = ignore # ignore/add/remove/force
# Add or remove space between nested parentheses with user functions,
# i.e. '((' vs. '( ('.
sp_func_call_user_paren_paren = ignore # ignore/add/remove/force
# Add or remove space between a constructor/destructor and the open
# parenthesis.
sp_func_class_paren = ignore # ignore/add/remove/force
# Add or remove space between a constructor without parameters or destructor
# and '()'.
sp_func_class_paren_empty = ignore # ignore/add/remove/force
# Add or remove space between 'return' and '('.
sp_return_paren = ignore # ignore/add/remove/force
# Add or remove space between 'return' and '{'.
sp_return_brace = ignore # ignore/add/remove/force
# Add or remove space between '__attribute__' and '('.
sp_attribute_paren = ignore # ignore/add/remove/force
# Add or remove space between 'defined' and '(' in '#if defined (FOO)'.
sp_defined_paren = ignore # ignore/add/remove/force
# Add or remove space between 'throw' and '(' in 'throw (something)'.
sp_throw_paren = ignore # ignore/add/remove/force
# Add or remove space between 'throw' and anything other than '(' as in
# '@throw [...];'.
sp_after_throw = ignore # ignore/add/remove/force
# Add or remove space between 'catch' and '(' in 'catch (something) { }'.
# If set to ignore, sp_before_sparen is used.
sp_catch_paren = ignore # ignore/add/remove/force
# (OC) Add or remove space between '@catch' and '('
# in '@catch (something) { }'. If set to ignore, sp_catch_paren is used.
sp_oc_catch_paren = ignore # ignore/add/remove/force
# (D) Add or remove space between 'version' and '('
# in 'version (something) { }'. If set to ignore, sp_before_sparen is used.
sp_version_paren = ignore # ignore/add/remove/force
# (D) Add or remove space between 'scope' and '('
# in 'scope (something) { }'. If set to ignore, sp_before_sparen is used.
sp_scope_paren = ignore # ignore/add/remove/force
# Add or remove space between 'super' and '(' in 'super (something)'.
#
# Default: remove
sp_super_paren = remove # ignore/add/remove/force
# Add or remove space between 'this' and '(' in 'this (something)'.
#
# Default: remove
sp_this_paren = remove # ignore/add/remove/force
# Add or remove space between a macro name and its definition.
sp_macro = ignore # ignore/add/remove/force
# Add or remove space between a macro function ')' and its definition.
sp_macro_func = ignore # ignore/add/remove/force
# Add or remove space between 'else' and '{' if on the same line.
sp_else_brace = ignore # ignore/add/remove/force
# Add or remove space between '}' and 'else' if on the same line.
sp_brace_else = ignore # ignore/add/remove/force
# Add or remove space between '}' and the name of a typedef on the same line.
sp_brace_typedef = ignore # ignore/add/remove/force
# Add or remove space before the '{' of a 'catch' statement, if the '{' and
# 'catch' are on the same line, as in 'catch (decl) <here> {'.
sp_catch_brace = ignore # ignore/add/remove/force
# (OC) Add or remove space before the '{' of a '@catch' statement, if the '{'
# and '@catch' are on the same line, as in '@catch (decl) <here> {'.
# If set to ignore, sp_catch_brace is used.
sp_oc_catch_brace = ignore # ignore/add/remove/force
# Add or remove space between '}' and 'catch' if on the same line.
sp_brace_catch = ignore # ignore/add/remove/force
# (OC) Add or remove space between '}' and '@catch' if on the same line.
# If set to ignore, sp_brace_catch is used.
sp_oc_brace_catch = ignore # ignore/add/remove/force
# Add or remove space between 'finally' and '{' if on the same line.
sp_finally_brace = ignore # ignore/add/remove/force
# Add or remove space between '}' and 'finally' if on the same line.
sp_brace_finally = ignore # ignore/add/remove/force
# Add or remove space between 'try' and '{' if on the same line.
sp_try_brace = ignore # ignore/add/remove/force
# Add or remove space between get/set and '{' if on the same line.
sp_getset_brace = ignore # ignore/add/remove/force
# Add or remove space between a variable and '{' for C++ uniform
# initialization.
#
# Default: add
sp_word_brace = add # ignore/add/remove/force
# Add or remove space between a variable and '{' for a namespace.
#
# Default: add
sp_word_brace_ns = add # ignore/add/remove/force
# Add or remove space before the '::' operator.
sp_before_dc = ignore # ignore/add/remove/force
# Add or remove space after the '::' operator.
sp_after_dc = ignore # ignore/add/remove/force
# (D) Add or remove around the D named array initializer ':' operator.
sp_d_array_colon = ignore # ignore/add/remove/force
# Add or remove space after the '!' (not) unary operator.
#
# Default: remove
sp_not = remove # ignore/add/remove/force
# Add or remove space after the '~' (invert) unary operator.
#
# Default: remove
sp_inv = remove # ignore/add/remove/force
# Add or remove space after the '&' (address-of) unary operator. This does not
# affect the spacing after a '&' that is part of a type.
#
# Default: remove
sp_addr = remove # ignore/add/remove/force
# Add or remove space around the '.' or '->' operators.
#
# Default: remove
sp_member = remove # ignore/add/remove/force
# Add or remove space after the '*' (dereference) unary operator. This does
# not affect the spacing after a '*' that is part of a type.
#
# Default: remove
sp_deref = remove # ignore/add/remove/force
# Add or remove space after '+' or '-', as in 'x = -5' or 'y = +7'.
#
# Default: remove
sp_sign = remove # ignore/add/remove/force
# Add or remove space between '++' and '--' the word to which it is being
# applied, as in '(--x)' or 'y++;'.
#
# Default: remove
sp_incdec = remove # ignore/add/remove/force
# Add or remove space before a backslash-newline at the end of a line.
#
# Default: add
sp_before_nl_cont = add # ignore/add/remove/force
# (OC) Add or remove space after the scope '+' or '-', as in '-(void) foo;'
# or '+(int) bar;'.
sp_after_oc_scope = ignore # ignore/add/remove/force
# (OC) Add or remove space after the colon in message specs,
# i.e. '-(int) f:(int) x;' vs. '-(int) f: (int) x;'.
sp_after_oc_colon = ignore # ignore/add/remove/force
# (OC) Add or remove space before the colon in message specs,
# i.e. '-(int) f: (int) x;' vs. '-(int) f : (int) x;'.
sp_before_oc_colon = ignore # ignore/add/remove/force
# (OC) Add or remove space after the colon in immutable dictionary expression
# 'NSDictionary *test = @{@"foo" :@"bar"};'.
sp_after_oc_dict_colon = ignore # ignore/add/remove/force
# (OC) Add or remove space before the colon in immutable dictionary expression
# 'NSDictionary *test = @{@"foo" :@"bar"};'.
sp_before_oc_dict_colon = ignore # ignore/add/remove/force
# (OC) Add or remove space after the colon in message specs,
# i.e. '[object setValue:1];' vs. '[object setValue: 1];'.
sp_after_send_oc_colon = ignore # ignore/add/remove/force
# (OC) Add or remove space before the colon in message specs,
# i.e. '[object setValue:1];' vs. '[object setValue :1];'.
sp_before_send_oc_colon = ignore # ignore/add/remove/force
# (OC) Add or remove space after the (type) in message specs,
# i.e. '-(int)f: (int) x;' vs. '-(int)f: (int)x;'.
sp_after_oc_type = ignore # ignore/add/remove/force
# (OC) Add or remove space after the first (type) in message specs,
# i.e. '-(int) f:(int)x;' vs. '-(int)f:(int)x;'.
sp_after_oc_return_type = ignore # ignore/add/remove/force
# (OC) Add or remove space between '@selector' and '(',
# i.e. '@selector(msgName)' vs. '@selector (msgName)'.
# Also applies to '@protocol()' constructs.
sp_after_oc_at_sel = ignore # ignore/add/remove/force
# (OC) Add or remove space between '@selector(x)' and the following word,
# i.e. '@selector(foo) a:' vs. '@selector(foo)a:'.
sp_after_oc_at_sel_parens = ignore # ignore/add/remove/force
# (OC) Add or remove space inside '@selector' parentheses,
# i.e. '@selector(foo)' vs. '@selector( foo )'.
# Also applies to '@protocol()' constructs.
sp_inside_oc_at_sel_parens = ignore # ignore/add/remove/force
# (OC) Add or remove space before a block pointer caret,
# i.e. '^int (int arg){...}' vs. ' ^int (int arg){...}'.
sp_before_oc_block_caret = ignore # ignore/add/remove/force
# (OC) Add or remove space after a block pointer caret,
# i.e. '^int (int arg){...}' vs. '^ int (int arg){...}'.
sp_after_oc_block_caret = ignore # ignore/add/remove/force
# (OC) Add or remove space between the receiver and selector in a message,
# as in '[receiver selector ...]'.
sp_after_oc_msg_receiver = ignore # ignore/add/remove/force
# (OC) Add or remove space after '@property'.
sp_after_oc_property = ignore # ignore/add/remove/force
# (OC) Add or remove space between '@synchronized' and the open parenthesis,
# i.e. '@synchronized(foo)' vs. '@synchronized (foo)'.
sp_after_oc_synchronized = ignore # ignore/add/remove/force
# Add or remove space around the ':' in 'b ? t : f'.
sp_cond_colon = ignore # ignore/add/remove/force
# Add or remove space before the ':' in 'b ? t : f'.
#
# Overrides sp_cond_colon.
sp_cond_colon_before = ignore # ignore/add/remove/force
# Add or remove space after the ':' in 'b ? t : f'.
#
# Overrides sp_cond_colon.
sp_cond_colon_after = ignore # ignore/add/remove/force
# Add or remove space around the '?' in 'b ? t : f'.
sp_cond_question = ignore # ignore/add/remove/force
# Add or remove space before the '?' in 'b ? t : f'.
#
# Overrides sp_cond_question.
sp_cond_question_before = ignore # ignore/add/remove/force
# Add or remove space after the '?' in 'b ? t : f'.
#
# Overrides sp_cond_question.
sp_cond_question_after = ignore # ignore/add/remove/force
# In the abbreviated ternary form '(a ?: b)', add or remove space between '?'
# and ':'.
#
# Overrides all other sp_cond_* options.
sp_cond_ternary_short = ignore # ignore/add/remove/force
# Fix the spacing between 'case' and the label. Only 'ignore' and 'force' make
# sense here.
sp_case_label = ignore # ignore/add/remove/force
# (D) Add or remove space around the D '..' operator.
sp_range = ignore # ignore/add/remove/force
# Add or remove space after ':' in a Java/C++11 range-based 'for',
# as in 'for (Type var : expr)'.
sp_after_for_colon = ignore # ignore/add/remove/force
# Add or remove space before ':' in a Java/C++11 range-based 'for',
# as in 'for (Type var : expr)'.
sp_before_for_colon = ignore # ignore/add/remove/force
# (D) Add or remove space between 'extern' and '(' as in 'extern (C)'.
sp_extern_paren = ignore # ignore/add/remove/force
# Add or remove space after the opening of a C++ comment,
# i.e. '// A' vs. '//A'.
sp_cmt_cpp_start = ignore # ignore/add/remove/force
# If true, space is added with sp_cmt_cpp_start will be added after doxygen
# sequences like '///', '///<', '//!' and '//!<'.
sp_cmt_cpp_doxygen = false # true/false
# If true, space is added with sp_cmt_cpp_start will be added after Qt
# translator or meta-data comments like '//:', '//=', and '//~'.
sp_cmt_cpp_qttr = false # true/false
# Add or remove space between #else or #endif and a trailing comment.
sp_endif_cmt = ignore # ignore/add/remove/force
# Add or remove space after 'new', 'delete' and 'delete[]'.
sp_after_new = ignore # ignore/add/remove/force
# Add or remove space between 'new' and '(' in 'new()'.
sp_between_new_paren = ignore # ignore/add/remove/force
# Add or remove space between ')' and type in 'new(foo) BAR'.
sp_after_newop_paren = ignore # ignore/add/remove/force
# Add or remove space inside parenthesis of the new operator
# as in 'new(foo) BAR'.
sp_inside_newop_paren = ignore # ignore/add/remove/force
# Add or remove space after the open parenthesis of the new operator,
# as in 'new(foo) BAR'.
#
# Overrides sp_inside_newop_paren.
sp_inside_newop_paren_open = ignore # ignore/add/remove/force
# Add or remove space before the close parenthesis of the new operator,
# as in 'new(foo) BAR'.
#
# Overrides sp_inside_newop_paren.
sp_inside_newop_paren_close = ignore # ignore/add/remove/force
# Add or remove space before a trailing or embedded comment.
sp_before_tr_emb_cmt = ignore # ignore/add/remove/force
# Number of spaces before a trailing or embedded comment.
sp_num_before_tr_emb_cmt = 0 # unsigned number
# (Java) Add or remove space between an annotation and the open parenthesis.
sp_annotation_paren = ignore # ignore/add/remove/force
# If true, vbrace tokens are dropped to the previous token and skipped.
sp_skip_vbrace_tokens = false # true/false
# Add or remove space after 'noexcept'.
sp_after_noexcept = ignore # ignore/add/remove/force
# If true, a <TAB> is inserted after #define.
force_tab_after_define = false # true/false
#
# Indenting options
#
# The number of columns to indent per level. Usually 2, 3, 4, or 8.
#
# Default: 8
indent_columns = 8 # unsigned number
# The continuation indent. If non-zero, this overrides the indent of '(' and
# '=' continuation indents. Negative values are OK; negative value is absolute
# and not increased for each '(' level.
#
# For FreeBSD, this is set to 4.
indent_continue = 0 # number
# The continuation indent, only for class header line(s). If non-zero, this
# overrides the indent of 'class' continuation indents.
indent_continue_class_head = 0 # unsigned number
# Whether to indent empty lines (i.e. lines which contain only spaces before
# the newline character).
indent_single_newlines = false # true/false
# The continuation indent for func_*_param if they are true. If non-zero, this
# overrides the indent.
indent_param = 0 # unsigned number
# How to use tabs when indenting code.
#
# 0: Spaces only
# 1: Indent with tabs to brace level, align with spaces (default)
# 2: Indent and align with tabs, using spaces when not on a tabstop
#
# Default: 1
indent_with_tabs = 1 # unsigned number
# Whether to indent comments that are not at a brace level with tabs on a
# tabstop. Requires indent_with_tabs=2. If false, will use spaces.
indent_cmt_with_tabs = false # true/false
# Whether to indent strings broken by '\' so that they line up.
indent_align_string = false # true/false
# The number of spaces to indent multi-line XML strings.
# Requires indent_align_string=true.
indent_xml_string = 0 # unsigned number
# Spaces to indent '{' from level.
indent_brace = 0 # unsigned number
# Whether braces are indented to the body level.
indent_braces = false # true/false
# Whether to disable indenting function braces if indent_braces=true.
indent_braces_no_func = false # true/false
# Whether to disable indenting class braces if indent_braces=true.
indent_braces_no_class = false # true/false
# Whether to disable indenting struct braces if indent_braces=true.
indent_braces_no_struct = false # true/false
# Whether to indent based on the size of the brace parent,
# i.e. 'if' → 3 spaces, 'for' → 4 spaces, etc.
indent_brace_parent = false # true/false
# Whether to indent based on the open parenthesis instead of the open brace
# in '({\n'.
indent_paren_open_brace = false # true/false
# (C#) Whether to indent the brace of a C# delegate by another level.
indent_cs_delegate_brace = false # true/false
# (C#) Whether to indent a C# delegate (to handle delegates with no brace) by
# another level.
indent_cs_delegate_body = false # true/false
# Whether to indent the body of a 'namespace'.
indent_namespace = false # true/false
# Whether to indent only the first namespace, and not any nested namespaces.
# Requires indent_namespace=true.
indent_namespace_single_indent = false # true/false
# The number of spaces to indent a namespace block.
indent_namespace_level = 0 # unsigned number
# If the body of the namespace is longer than this number, it won't be
# indented. Requires indent_namespace=true. 0 means no limit.
indent_namespace_limit = 0 # unsigned number
# Whether the 'extern "C"' body is indented.
indent_extern = false # true/false
# Whether the 'class' body is indented.
indent_class = false # true/false
# Whether to indent the stuff after a leading base class colon.
indent_class_colon = false # true/false
# Whether to indent based on a class colon instead of the stuff after the
# colon. Requires indent_class_colon=true.
indent_class_on_colon = false # true/false
# Whether to indent the stuff after a leading class initializer colon.
indent_constr_colon = false # true/false
# Virtual indent from the ':' for member initializers.
#
# Default: 2
indent_ctor_init_leading = 2 # unsigned number
# Additional indent for constructor initializer list.
# Negative values decrease indent down to the first column.
indent_ctor_init = 0 # number
# Whether to indent 'if' following 'else' as a new block under the 'else'.
# If false, 'else\nif' is treated as 'else if' for indenting purposes.
indent_else_if = false # true/false
# Amount to indent variable declarations after a open brace.
#
# <0: Relative
# ≥0: Absolute
indent_var_def_blk = 0 # number
# Whether to indent continued variable declarations instead of aligning.
indent_var_def_cont = false # true/false
# Whether to indent continued shift expressions ('<<' and '>>') instead of
# aligning. Set align_left_shift=false when enabling this.
indent_shift = false # true/false
# Whether to force indentation of function definitions to start in column 1.
indent_func_def_force_col1 = false # true/false
# Whether to indent continued function call parameters one indent level,
# rather than aligning parameters under the open parenthesis.
indent_func_call_param = false # true/false
# Same as indent_func_call_param, but for function definitions.
indent_func_def_param = false # true/false
# Same as indent_func_call_param, but for function prototypes.
indent_func_proto_param = false # true/false
# Same as indent_func_call_param, but for class declarations.
indent_func_class_param = false # true/false
# Same as indent_func_call_param, but for class variable constructors.
indent_func_ctor_var_param = false # true/false
# Same as indent_func_call_param, but for template parameter lists.
indent_template_param = false # true/false
# Double the indent for indent_func_xxx_param options.
# Use both values of the options indent_columns and indent_param.
indent_func_param_double = false # true/false
# Indentation column for standalone 'const' qualifier on a function
# prototype.
indent_func_const = 0 # unsigned number
# Indentation column for standalone 'throw' qualifier on a function
# prototype.
indent_func_throw = 0 # unsigned number
# The number of spaces to indent a continued '->' or '.'.
# Usually set to 0, 1, or indent_columns.
indent_member = 0 # unsigned number
# Whether lines broken at '.' or '->' should be indented by a single indent.
# The indent_member option will not be effective if this is set to true.
indent_member_single = false # true/false
# Spaces to indent single line ('//') comments on lines before code.
indent_sing_line_comments = 0 # unsigned number
# Whether to indent trailing single line ('//') comments relative to the code
# instead of trying to keep the same absolute column.
indent_relative_single_line_comments = false # true/false
# Spaces to indent 'case' from 'switch'. Usually 0 or indent_columns.
indent_switch_case = 0 # unsigned number
# Whether to indent preprocessor statements inside of switch statements.
#
# Default: true
indent_switch_pp = true # true/false
# Spaces to shift the 'case' line, without affecting any other lines.
# Usually 0.
indent_case_shift = 0 # unsigned number
# Spaces to indent '{' from 'case'. By default, the brace will appear under
# the 'c' in case. Usually set to 0 or indent_columns. Negative values are OK.
indent_case_brace = 0 # number
# Whether to indent comments found in first column.
indent_col1_comment = false # true/false
# How to indent goto labels.
#
# >0: Absolute column where 1 is the leftmost column
# ≤0: Subtract from brace indent
#
# Default: 1
indent_label = 1 # number
# Same as indent_label, but for access specifiers that are followed by a
# colon.
#
# Default: 1
indent_access_spec = 1 # number
# Whether to indent the code after an access specifier by one level.
# If true, this option forces 'indent_access_spec=0'.
indent_access_spec_body = false # true/false
# If an open parenthesis is followed by a newline, whether to indent the next
# line so that it lines up after the open parenthesis (not recommended).
indent_paren_nl = false # true/false
# How to indent a close parenthesis after a newline.
#
# 0: Indent to body level (default)
# 1: Align under the open parenthesis
# 2: Indent to the brace level
indent_paren_close = 0 # unsigned number
# Whether to indent the open parenthesis of a function definition,
# if the parenthesis is on its own line.
indent_paren_after_func_def = false # true/false
# Whether to indent the open parenthesis of a function declaration,
# if the parenthesis is on its own line.
indent_paren_after_func_decl = false # true/false
# Whether to indent the open parenthesis of a function call,
# if the parenthesis is on its own line.
indent_paren_after_func_call = false # true/false
# Whether to indent a comma when inside a parenthesis.
# If true, aligns under the open parenthesis.
indent_comma_paren = false # true/false
# Whether to indent a Boolean operator when inside a parenthesis.
# If true, aligns under the open parenthesis.
indent_bool_paren = false # true/false
# Whether to indent a semicolon when inside a for parenthesis.
# If true, aligns under the open for parenthesis.
indent_semicolon_for_paren = false # true/false
# Whether to align the first expression to following ones
# if indent_bool_paren=true.
indent_first_bool_expr = false # true/false
# Whether to align the first expression to following ones
# if indent_semicolon_for_paren=true.
indent_first_for_expr = false # true/false
# If an open square is followed by a newline, whether to indent the next line
# so that it lines up after the open square (not recommended).
indent_square_nl = false # true/false
# (ESQL/C) Whether to preserve the relative indent of 'EXEC SQL' bodies.
indent_preserve_sql = false # true/false
# Whether to align continued statements at the '='. If false or if the '=' is
# followed by a newline, the next line is indent one tab.
#
# Default: true
indent_align_assign = true # true/false
# Whether to align continued statements at the '('. If false or the '(' is not
# followed by a newline, the next line indent is one tab.
#
# Default: true
indent_align_paren = true # true/false
# (OC) Whether to indent Objective-C blocks at brace level instead of usual
# rules.
indent_oc_block = false # true/false
# (OC) Indent for Objective-C blocks in a message relative to the parameter
# name.
#
# =0: Use indent_oc_block rules
# >0: Use specified number of spaces to indent
indent_oc_block_msg = 0 # unsigned number
# (OC) Minimum indent for subsequent parameters
indent_oc_msg_colon = 0 # unsigned number
# (OC) Whether to prioritize aligning with initial colon (and stripping spaces
# from lines, if necessary).
#
# Default: true
indent_oc_msg_prioritize_first_colon = true # true/false
# (OC) Whether to indent blocks the way that Xcode does by default
# (from the keyword if the parameter is on its own line; otherwise, from the
# previous indentation level). Requires indent_oc_block_msg=true.
indent_oc_block_msg_xcode_style = false # true/false
# (OC) Whether to indent blocks from where the brace is, relative to a
# message keyword. Requires indent_oc_block_msg=true.
indent_oc_block_msg_from_keyword = false # true/false
# (OC) Whether to indent blocks from where the brace is, relative to a message
# colon. Requires indent_oc_block_msg=true.
indent_oc_block_msg_from_colon = false # true/false
# (OC) Whether to indent blocks from where the block caret is.
# Requires indent_oc_block_msg=true.
indent_oc_block_msg_from_caret = false # true/false
# (OC) Whether to indent blocks from where the brace caret is.
# Requires indent_oc_block_msg=true.
indent_oc_block_msg_from_brace = false # true/false
# When indenting after virtual brace open and newline add further spaces to
# reach this minimum indent.
indent_min_vbrace_open = 0 # unsigned number
# Whether to add further spaces after regular indent to reach next tabstop
# when identing after virtual brace open and newline.
indent_vbrace_open_on_tabstop = false # true/false
# How to indent after a brace followed by another token (not a newline).
# true: indent all contained lines to match the token
# false: indent all contained lines to match the brace
#
# Default: true
indent_token_after_brace = true # true/false
# Whether to indent the body of a C++11 lambda.
indent_cpp_lambda_body = false # true/false
# (C#) Whether to indent a 'using' block if no braces are used.
#
# Default: true
indent_using_block = true # true/false
# How to indent the continuation of ternary operator.
#
# 0: Off (default)
# 1: When the `if_false` is a continuation, indent it under `if_false`
# 2: When the `:` is a continuation, indent it under `?`
indent_ternary_operator = 0 # unsigned number
# If true, the indentation of the chunks after a `return new` sequence will be set at return indentation column.
indent_off_after_return_new = false # true/false
# If true, the tokens after return are indented with regular single indentation. By default (false) the indentation is after the return token.
indent_single_after_return = false # true/false
# Whether to ignore indent and alignment for 'asm' blocks (i.e. assume they
# have their own indentation).
indent_ignore_asm_block = false # true/false
#
# Newline adding and removing options
#
# Whether to collapse empty blocks between '{' and '}'.
nl_collapse_empty_body = false # true/false
# Don't split one-line braced assignments, as in 'foo_t f = { 1, 2 };'.
nl_assign_leave_one_liners = false # true/false
# Don't split one-line braced statements inside a 'class xx { }' body.
nl_class_leave_one_liners = false # true/false
# Don't split one-line enums, as in 'enum foo { BAR = 15 };'
nl_enum_leave_one_liners = false # true/false
# Don't split one-line get or set functions.
nl_getset_leave_one_liners = false # true/false
# (C#) Don't split one-line property get or set functions.
nl_cs_property_leave_one_liners = false # true/false
# Don't split one-line function definitions, as in 'int foo() { return 0; }'.
nl_func_leave_one_liners = false # true/false
# Don't split one-line C++11 lambdas, as in '[]() { return 0; }'.
nl_cpp_lambda_leave_one_liners = false # true/false
# Don't split one-line if/else statements, as in 'if(...) b++;'.
nl_if_leave_one_liners = false # true/false
# Don't split one-line while statements, as in 'while(...) b++;'.
nl_while_leave_one_liners = false # true/false
# Don't split one-line for statements, as in 'for(...) b++;'.
nl_for_leave_one_liners = false # true/false
# (OC) Don't split one-line Objective-C messages.
nl_oc_msg_leave_one_liner = false # true/false
# (OC) Add or remove newline between method declaration and '{'.
nl_oc_mdef_brace = ignore # ignore/add/remove/force
# (OC) Add or remove newline between Objective-C block signature and '{'.
nl_oc_block_brace = ignore # ignore/add/remove/force
# (OC) Add or remove newline between '@interface' and '{'.
nl_oc_interface_brace = ignore # ignore/add/remove/force
# (OC) Add or remove newline between '@implementation' and '{'.
nl_oc_implementation_brace = ignore # ignore/add/remove/force
# Add or remove newlines at the start of the file.
nl_start_of_file = ignore # ignore/add/remove/force
# The minimum number of newlines at the start of the file (only used if
# nl_start_of_file is 'add' or 'force').
nl_start_of_file_min = 0 # unsigned number
# Add or remove newline at the end of the file.
nl_end_of_file = ignore # ignore/add/remove/force
# The minimum number of newlines at the end of the file (only used if
# nl_end_of_file is 'add' or 'force').
nl_end_of_file_min = 0 # unsigned number
# Add or remove newline between '=' and '{'.
nl_assign_brace = ignore # ignore/add/remove/force
# (D) Add or remove newline between '=' and '['.
nl_assign_square = ignore # ignore/add/remove/force
# Add or remove newline between '[]' and '{'.
nl_tsquare_brace = ignore # ignore/add/remove/force
# (D) Add or remove newline after '= ['. Will also affect the newline before
# the ']'.
nl_after_square_assign = ignore # ignore/add/remove/force
# The number of blank lines after a block of variable definitions at the top
# of a function body.
#
# 0 = No change (default).
nl_func_var_def_blk = 0 # unsigned number
# The number of newlines before a block of typedefs. If nl_after_access_spec
# is non-zero, that option takes precedence.
#
# 0 = No change (default).
nl_typedef_blk_start = 0 # unsigned number
# The number of newlines after a block of typedefs.
#
# 0 = No change (default).
nl_typedef_blk_end = 0 # unsigned number
# The maximum number of consecutive newlines within a block of typedefs.
#
# 0 = No change (default).
nl_typedef_blk_in = 0 # unsigned number
# The number of newlines before a block of variable definitions not at the top
# of a function body. If nl_after_access_spec is non-zero, that option takes
# precedence.
#
# 0 = No change (default).
nl_var_def_blk_start = 0 # unsigned number
# The number of newlines after a block of variable definitions not at the top
# of a function body.
#
# 0 = No change (default).
nl_var_def_blk_end = 0 # unsigned number
# The maximum number of consecutive newlines within a block of variable
# definitions.
#
# 0 = No change (default).
nl_var_def_blk_in = 0 # unsigned number
# Add or remove newline between a function call's ')' and '{', as in
# 'list_for_each(item, &list) { }'.
nl_fcall_brace = ignore # ignore/add/remove/force
# Add or remove newline between 'enum' and '{'.
nl_enum_brace = ignore # ignore/add/remove/force
# Add or remove newline between 'enum' and 'class'.
nl_enum_class = ignore # ignore/add/remove/force
# Add or remove newline between 'enum class' and the identifier.
nl_enum_class_identifier = ignore # ignore/add/remove/force
# Add or remove newline between 'enum class' type and ':'.
nl_enum_identifier_colon = ignore # ignore/add/remove/force
# Add or remove newline between 'enum class identifier :' and type.
nl_enum_colon_type = ignore # ignore/add/remove/force
# Add or remove newline between 'struct and '{'.
nl_struct_brace = ignore # ignore/add/remove/force
# Add or remove newline between 'union' and '{'.
nl_union_brace = ignore # ignore/add/remove/force
# Add or remove newline between 'if' and '{'.
nl_if_brace = ignore # ignore/add/remove/force
# Add or remove newline between '}' and 'else'.
nl_brace_else = ignore # ignore/add/remove/force
# Add or remove newline between 'else if' and '{'. If set to ignore,
# nl_if_brace is used instead.
nl_elseif_brace = ignore # ignore/add/remove/force
# Add or remove newline between 'else' and '{'.
nl_else_brace = ignore # ignore/add/remove/force
# Add or remove newline between 'else' and 'if'.
nl_else_if = ignore # ignore/add/remove/force
# Add or remove newline before 'if'/'else if' closing parenthesis.
nl_before_if_closing_paren = ignore # ignore/add/remove/force
# Add or remove newline between '}' and 'finally'.
nl_brace_finally = ignore # ignore/add/remove/force
# Add or remove newline between 'finally' and '{'.
nl_finally_brace = ignore # ignore/add/remove/force
# Add or remove newline between 'try' and '{'.
nl_try_brace = ignore # ignore/add/remove/force
# Add or remove newline between get/set and '{'.
nl_getset_brace = ignore # ignore/add/remove/force
# Add or remove newline between 'for' and '{'.
nl_for_brace = ignore # ignore/add/remove/force
# Add or remove newline before the '{' of a 'catch' statement, as in
# 'catch (decl) <here> {'.
nl_catch_brace = ignore # ignore/add/remove/force
# (OC) Add or remove newline before the '{' of a '@catch' statement, as in
# '@catch (decl) <here> {'. If set to ignore, nl_catch_brace is used.
nl_oc_catch_brace = ignore # ignore/add/remove/force
# Add or remove newline between '}' and 'catch'.
nl_brace_catch = ignore # ignore/add/remove/force
# (OC) Add or remove newline between '}' and '@catch'. If set to ignore,
# nl_brace_catch is used.
nl_oc_brace_catch = ignore # ignore/add/remove/force
# Add or remove newline between '}' and ']'.
nl_brace_square = ignore # ignore/add/remove/force
# Add or remove newline between '}' and ')' in a function invocation.
nl_brace_fparen = ignore # ignore/add/remove/force
# Add or remove newline between 'while' and '{'.
nl_while_brace = ignore # ignore/add/remove/force
# (D) Add or remove newline between 'scope (x)' and '{'.
nl_scope_brace = ignore # ignore/add/remove/force
# (D) Add or remove newline between 'unittest' and '{'.
nl_unittest_brace = ignore # ignore/add/remove/force
# (D) Add or remove newline between 'version (x)' and '{'.
nl_version_brace = ignore # ignore/add/remove/force
# (C#) Add or remove newline between 'using' and '{'.
nl_using_brace = ignore # ignore/add/remove/force
# Add or remove newline between two open or close braces. Due to general
# newline/brace handling, REMOVE may not work.
nl_brace_brace = ignore # ignore/add/remove/force
# Add or remove newline between 'do' and '{'.
nl_do_brace = ignore # ignore/add/remove/force
# Add or remove newline between '}' and 'while' of 'do' statement.
nl_brace_while = ignore # ignore/add/remove/force
# Add or remove newline between 'switch' and '{'.
nl_switch_brace = ignore # ignore/add/remove/force
# Add or remove newline between 'synchronized' and '{'.
nl_synchronized_brace = ignore # ignore/add/remove/force
# Add a newline between ')' and '{' if the ')' is on a different line than the
# if/for/etc.
#
# Overrides nl_for_brace, nl_if_brace, nl_switch_brace, nl_while_switch and
# nl_catch_brace.
nl_multi_line_cond = false # true/false
# Force a newline in a define after the macro name for multi-line defines.
nl_multi_line_define = false # true/false
# Whether to add a newline before 'case', and a blank line before a 'case'
# statement that follows a ';' or '}'.
nl_before_case = false # true/false
# Whether to add a newline after a 'case' statement.
nl_after_case = false # true/false
# Add or remove newline between a case ':' and '{'.
#
# Overrides nl_after_case.
nl_case_colon_brace = ignore # ignore/add/remove/force
# Add or remove newline between ')' and 'throw'.
nl_before_throw = ignore # ignore/add/remove/force
# Add or remove newline between 'namespace' and '{'.
nl_namespace_brace = ignore # ignore/add/remove/force
# Add or remove newline between 'template<>' and whatever follows.
nl_template_class = ignore # ignore/add/remove/force
# Add or remove newline between 'class' and '{'.
nl_class_brace = ignore # ignore/add/remove/force
# Add or remove newline before or after (depending on pos_class_comma) each
# ',' in the base class list.
nl_class_init_args = ignore # ignore/add/remove/force
# Add or remove newline after each ',' in the constructor member
# initialization. Related to nl_constr_colon, pos_constr_colon and
# pos_constr_comma.
nl_constr_init_args = ignore # ignore/add/remove/force
# Add or remove newline before first element, after comma, and after last
# element, in 'enum'.
nl_enum_own_lines = ignore # ignore/add/remove/force
# Add or remove newline between return type and function name in a function
# definition.
nl_func_type_name = ignore # ignore/add/remove/force
# Add or remove newline between return type and function name inside a class
# definition. If set to ignore, nl_func_type_name or nl_func_proto_type_name
# is used instead.
nl_func_type_name_class = ignore # ignore/add/remove/force
# Add or remove newline between class specification and '::'
# in 'void A::f() { }'. Only appears in separate member implementation (does
# not appear with in-line implementation).
nl_func_class_scope = ignore # ignore/add/remove/force
# Add or remove newline between function scope and name, as in
# 'void A :: <here> f() { }'.
nl_func_scope_name = ignore # ignore/add/remove/force
# Add or remove newline between return type and function name in a prototype.
nl_func_proto_type_name = ignore # ignore/add/remove/force
# Add or remove newline between a function name and the opening '(' in the
# declaration.
nl_func_paren = ignore # ignore/add/remove/force
# Overrides nl_func_paren for functions with no parameters.
nl_func_paren_empty = ignore # ignore/add/remove/force
# Add or remove newline between a function name and the opening '(' in the
# definition.
nl_func_def_paren = ignore # ignore/add/remove/force
# Overrides nl_func_def_paren for functions with no parameters.
nl_func_def_paren_empty = ignore # ignore/add/remove/force
# Add or remove newline between a function name and the opening '(' in the
# call.
nl_func_call_paren = ignore # ignore/add/remove/force
# Overrides nl_func_call_paren for functions with no parameters.
nl_func_call_paren_empty = ignore # ignore/add/remove/force
# Add or remove newline after '(' in a function declaration.
nl_func_decl_start = ignore # ignore/add/remove/force
# Add or remove newline after '(' in a function definition.
nl_func_def_start = ignore # ignore/add/remove/force
# Overrides nl_func_decl_start when there is only one parameter.
nl_func_decl_start_single = ignore # ignore/add/remove/force
# Overrides nl_func_def_start when there is only one parameter.
nl_func_def_start_single = ignore # ignore/add/remove/force
# Whether to add a newline after '(' in a function declaration if '(' and ')'
# are in different lines. If false, nl_func_decl_start is used instead.
nl_func_decl_start_multi_line = false # true/false
# Whether to add a newline after '(' in a function definition if '(' and ')'
# are in different lines. If false, nl_func_def_start is used instead.
nl_func_def_start_multi_line = false # true/false
# Add or remove newline after each ',' in a function declaration.
nl_func_decl_args = ignore # ignore/add/remove/force
# Add or remove newline after each ',' in a function definition.
nl_func_def_args = ignore # ignore/add/remove/force
# Whether to add a newline after each ',' in a function declaration if '('
# and ')' are in different lines. If false, nl_func_decl_args is used instead.
nl_func_decl_args_multi_line = false # true/false
# Whether to add a newline after each ',' in a function definition if '('
# and ')' are in different lines. If false, nl_func_def_args is used instead.
nl_func_def_args_multi_line = false # true/false
# Add or remove newline before the ')' in a function declaration.
nl_func_decl_end = ignore # ignore/add/remove/force
# Add or remove newline before the ')' in a function definition.
nl_func_def_end = ignore # ignore/add/remove/force
# Overrides nl_func_decl_end when there is only one parameter.
nl_func_decl_end_single = ignore # ignore/add/remove/force
# Overrides nl_func_def_end when there is only one parameter.
nl_func_def_end_single = ignore # ignore/add/remove/force
# Whether to add a newline before ')' in a function declaration if '(' and ')'
# are in different lines. If false, nl_func_decl_end is used instead.
nl_func_decl_end_multi_line = false # true/false
# Whether to add a newline before ')' in a function definition if '(' and ')'
# are in different lines. If false, nl_func_def_end is used instead.
nl_func_def_end_multi_line = false # true/false
# Add or remove newline between '()' in a function declaration.
nl_func_decl_empty = ignore # ignore/add/remove/force
# Add or remove newline between '()' in a function definition.
nl_func_def_empty = ignore # ignore/add/remove/force
# Add or remove newline between '()' in a function call.
nl_func_call_empty = ignore # ignore/add/remove/force
# Whether to add a newline after '(' in a function call if '(' and ')' are in
# different lines.
nl_func_call_start_multi_line = false # true/false
# Whether to add a newline after each ',' in a function call if '(' and ')'
# are in different lines.
nl_func_call_args_multi_line = false # true/false
# Whether to add a newline before ')' in a function call if '(' and ')' are in
# different lines.
nl_func_call_end_multi_line = false # true/false
# (OC) Whether to put each Objective-C message parameter on a separate line.
# See nl_oc_msg_leave_one_liner.
nl_oc_msg_args = false # true/false
# Add or remove newline between function signature and '{'.
nl_fdef_brace = ignore # ignore/add/remove/force
# Add or remove newline between C++11 lambda signature and '{'.
nl_cpp_ldef_brace = ignore # ignore/add/remove/force
# Add or remove newline between 'return' and the return expression.
nl_return_expr = ignore # ignore/add/remove/force
# Whether to add a newline after semicolons, except in 'for' statements.
nl_after_semicolon = false # true/false
# (Java) Add or remove newline between the ')' and '{{' of the double brace
# initializer.
nl_paren_dbrace_open = ignore # ignore/add/remove/force
# Whether to add a newline after the type in an unnamed temporary
# direct-list-initialization.
nl_type_brace_init_lst = ignore # ignore/add/remove/force
# Whether to add a newline after the open brace in an unnamed temporary
# direct-list-initialization.
nl_type_brace_init_lst_open = ignore # ignore/add/remove/force
# Whether to add a newline before the close brace in an unnamed temporary
# direct-list-initialization.
nl_type_brace_init_lst_close = ignore # ignore/add/remove/force
# Whether to add a newline after '{'. This also adds a newline before the
# matching '}'.
nl_after_brace_open = false # true/false
# Whether to add a newline between the open brace and a trailing single-line
# comment. Requires nl_after_brace_open=true.
nl_after_brace_open_cmt = false # true/false
# Whether to add a newline after a virtual brace open with a non-empty body.
# These occur in un-braced if/while/do/for statement bodies.
nl_after_vbrace_open = false # true/false
# Whether to add a newline after a virtual brace open with an empty body.
# These occur in un-braced if/while/do/for statement bodies.
nl_after_vbrace_open_empty = false # true/false
# Whether to add a newline after '}'. Does not apply if followed by a
# necessary ';'.
nl_after_brace_close = false # true/false
# Whether to add a newline after a virtual brace close,
# as in 'if (foo) a++; <here> return;'.
nl_after_vbrace_close = false # true/false
# Add or remove newline between the close brace and identifier,
# as in 'struct { int a; } <here> b;'. Affects enumerations, unions and
# structures. If set to ignore, uses nl_after_brace_close.
nl_brace_struct_var = ignore # ignore/add/remove/force
# Whether to alter newlines in '#define' macros.
nl_define_macro = false # true/false
# Whether to alter newlines between consecutive parenthesis closes. The number
# of closing parentheses in a line will depend on respective open parenthesis
# lines.
nl_squeeze_paren_close = false # true/false
# Whether to remove blanks after '#ifxx' and '#elxx', or before '#elxx' and
# '#endif'. Does not affect top-level #ifdefs.
nl_squeeze_ifdef = false # true/false
# Makes the nl_squeeze_ifdef option affect the top-level #ifdefs as well.
nl_squeeze_ifdef_top_level = false # true/false
# Add or remove blank line before 'if'.
nl_before_if = ignore # ignore/add/remove/force
# Add or remove blank line after 'if' statement. Add/Force work only if the
# next token is not a closing brace.
nl_after_if = ignore # ignore/add/remove/force
# Add or remove blank line before 'for'.
nl_before_for = ignore # ignore/add/remove/force
# Add or remove blank line after 'for' statement.
nl_after_for = ignore # ignore/add/remove/force
# Add or remove blank line before 'while'.
nl_before_while = ignore # ignore/add/remove/force
# Add or remove blank line after 'while' statement.
nl_after_while = ignore # ignore/add/remove/force
# Add or remove blank line before 'switch'.
nl_before_switch = ignore # ignore/add/remove/force
# Add or remove blank line after 'switch' statement.
nl_after_switch = ignore # ignore/add/remove/force
# Add or remove blank line before 'synchronized'.
nl_before_synchronized = ignore # ignore/add/remove/force
# Add or remove blank line after 'synchronized' statement.
nl_after_synchronized = ignore # ignore/add/remove/force
# Add or remove blank line before 'do'.
nl_before_do = ignore # ignore/add/remove/force
# Add or remove blank line after 'do/while' statement.
nl_after_do = ignore # ignore/add/remove/force
# Whether to double-space commented-entries in 'struct'/'union'/'enum'.
nl_ds_struct_enum_cmt = false # true/false
# Whether to force a newline before '}' of a 'struct'/'union'/'enum'.
# (Lower priority than eat_blanks_before_close_brace.)
nl_ds_struct_enum_close_brace = false # true/false
# Add or remove newline before or after (depending on pos_class_colon) a class
# colon, as in 'class Foo <here> : <or here> public Bar'.
nl_class_colon = ignore # ignore/add/remove/force
# Add or remove newline around a class constructor colon. The exact position
# depends on nl_constr_init_args, pos_constr_colon and pos_constr_comma.
nl_constr_colon = ignore # ignore/add/remove/force
# Whether to collapse a two-line namespace, like 'namespace foo\n{ decl; }'
# into a single line. If true, prevents other brace newline rules from turning
# such code into four lines.
nl_namespace_two_to_one_liner = false # true/false
# Whether to remove a newline in simple unbraced if statements, turning them
# into one-liners, as in 'if(b)\n i++;' → 'if(b) i++;'.
nl_create_if_one_liner = false # true/false
# Whether to remove a newline in simple unbraced for statements, turning them
# into one-liners, as in 'for (...)\n stmt;' → 'for (...) stmt;'.
nl_create_for_one_liner = false # true/false
# Whether to remove a newline in simple unbraced while statements, turning
# them into one-liners, as in 'while (expr)\n stmt;' → 'while (expr) stmt;'.
nl_create_while_one_liner = false # true/false
# Whether to collapse a function definition whose body (not counting braces)
# is only one line so that the entire definition (prototype, braces, body) is
# a single line.
nl_create_func_def_one_liner = false # true/false
# Whether to split one-line simple unbraced if statements into two lines by
# adding a newline, as in 'if(b) <here> i++;'.
nl_split_if_one_liner = false # true/false
# Whether to split one-line simple unbraced for statements into two lines by
# adding a newline, as in 'for (...) <here> stmt;'.
nl_split_for_one_liner = false # true/false
# Whether to split one-line simple unbraced while statements into two lines by
# adding a newline, as in 'while (expr) <here> stmt;'.
nl_split_while_one_liner = false # true/false
#
# Blank line options
#
# The maximum number of consecutive newlines (3 = 2 blank lines).
nl_max = 0 # unsigned number
# The maximum number of consecutive newlines in a function.
nl_max_blank_in_func = 0 # unsigned number
# The number of newlines before a function prototype.
nl_before_func_body_proto = 0 # unsigned number
# The number of newlines before a multi-line function definition.
nl_before_func_body_def = 0 # unsigned number
# The number of newlines before a class constructor/destructor prototype.
nl_before_func_class_proto = 0 # unsigned number
# The number of newlines before a class constructor/destructor definition.
nl_before_func_class_def = 0 # unsigned number
# The number of newlines after a function prototype.
nl_after_func_proto = 0 # unsigned number
# The number of newlines after a function prototype, if not followed by
# another function prototype.
nl_after_func_proto_group = 0 # unsigned number
# The number of newlines after a class constructor/destructor prototype.
nl_after_func_class_proto = 0 # unsigned number
# The number of newlines after a class constructor/destructor prototype,
# if not followed by another constructor/destructor prototype.
nl_after_func_class_proto_group = 0 # unsigned number
# Whether one-line method definitions inside a class body should be treated
# as if they were prototypes for the purposes of adding newlines.
#
# Requires nl_class_leave_one_liners=true. Overrides nl_before_func_body_def
# and nl_before_func_class_def for one-liners.
nl_class_leave_one_liner_groups = false # true/false
# The number of newlines after '}' of a multi-line function body.
nl_after_func_body = 0 # unsigned number
# The number of newlines after '}' of a multi-line function body in a class
# declaration. Also affects class constructors/destructors.
#
# Overrides nl_after_func_body.
nl_after_func_body_class = 0 # unsigned number
# The number of newlines after '}' of a single line function body. Also
# affects class constructors/destructors.
#
# Overrides nl_after_func_body and nl_after_func_body_class.
nl_after_func_body_one_liner = 0 # unsigned number
# The minimum number of newlines before a multi-line comment.
# Doesn't apply if after a brace open or another multi-line comment.
nl_before_block_comment = 0 # unsigned number
# The minimum number of newlines before a single-line C comment.
# Doesn't apply if after a brace open or other single-line C comments.
nl_before_c_comment = 0 # unsigned number
# The minimum number of newlines before a CPP comment.
# Doesn't apply if after a brace open or other CPP comments.
nl_before_cpp_comment = 0 # unsigned number
# Whether to force a newline after a multi-line comment.
nl_after_multiline_comment = false # true/false
# Whether to force a newline after a label's colon.
nl_after_label_colon = false # true/false
# The number of newlines after '}' or ';' of a struct/enum/union definition.
nl_after_struct = 0 # unsigned number
# The number of newlines before a class definition.
nl_before_class = 0 # unsigned number
# The number of newlines after '}' or ';' of a class definition.
nl_after_class = 0 # unsigned number
# The number of newlines before an access specifier label. This also includes
# the Qt-specific 'signals:' and 'slots:'. Will not change the newline count
# if after a brace open.
#
# 0 = No change (default).
nl_before_access_spec = 0 # unsigned number
# The number of newlines after an access specifier label. This also includes
# the Qt-specific 'signals:' and 'slots:'. Will not change the newline count
# if after a brace open.
#
# 0 = No change (default).
#
# Overrides nl_typedef_blk_start and nl_var_def_blk_start.
nl_after_access_spec = 0 # unsigned number
# The number of newlines between a function definition and the function
# comment, as in '// comment\n <here> void foo() {...}'.
#
# 0 = No change (default).
nl_comment_func_def = 0 # unsigned number
# The number of newlines after a try-catch-finally block that isn't followed
# by a brace close.
#
# 0 = No change (default).
nl_after_try_catch_finally = 0 # unsigned number
# (C#) The number of newlines before and after a property, indexer or event
# declaration.
#
# 0 = No change (default).
nl_around_cs_property = 0 # unsigned number
# (C#) The number of newlines between the get/set/add/remove handlers.
#
# 0 = No change (default).
nl_between_get_set = 0 # unsigned number
# (C#) Add or remove newline between property and the '{'.
nl_property_brace = ignore # ignore/add/remove/force
# The number of newlines after '{' of a namespace. This also adds newlines
# before the matching '}'.
#
# 0 = Apply eat_blanks_after_open_brace or eat_blanks_before_close_brace if
# applicable, otherwise no change.
#
# Overrides eat_blanks_after_open_brace and eat_blanks_before_close_brace.
nl_inside_namespace = 0 # unsigned number
# Whether to remove blank lines after '{'.
eat_blanks_after_open_brace = false # true/false
# Whether to remove blank lines before '}'.
eat_blanks_before_close_brace = false # true/false
# How aggressively to remove extra newlines not in preprocessor.
#
# 0: No change (default)
# 1: Remove most newlines not handled by other config
# 2: Remove all newlines and reformat completely by config
nl_remove_extra_newlines = 0 # unsigned number
# Whether to put a blank line before 'return' statements, unless after an open
# brace.
nl_before_return = false # true/false
# Whether to put a blank line after 'return' statements, unless followed by a
# close brace.
nl_after_return = false # true/false
# (Java) Add or remove newline after an annotation statement. Only affects
# annotations that are after a newline.
nl_after_annotation = ignore # ignore/add/remove/force
# (Java) Add or remove newline between two annotations.
nl_between_annotation = ignore # ignore/add/remove/force
#
# Positioning options
#
# The position of arithmetic operators in wrapped expressions.
pos_arith = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of assignment in wrapped expressions. Do not affect '='
# followed by '{'.
pos_assign = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of Boolean operators in wrapped expressions.
pos_bool = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of comparison operators in wrapped expressions.
pos_compare = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of conditional operators, as in the '?' and ':' of
# 'expr ? stmt : stmt', in wrapped expressions.
pos_conditional = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of the comma in wrapped expressions.
pos_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of the comma in enum entries.
pos_enum_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of the comma in the base class list if there is more than one
# line. Affects nl_class_init_args.
pos_class_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of the comma in the constructor initialization list.
# Related to nl_constr_colon, nl_constr_init_args and pos_constr_colon.
pos_constr_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of trailing/leading class colon, between class and base class
# list. Affects nl_class_colon.
pos_class_colon = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
# The position of colons between constructor and member initialization.
# Related to nl_constr_colon, nl_constr_init_args and pos_constr_comma.
pos_constr_colon = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
#
# Line splitting options
#
# Try to limit code width to N columns.
code_width = 0 # unsigned number
# Whether to fully split long 'for' statements at semi-colons.
ls_for_split_full = false # true/false
# Whether to fully split long function prototypes/calls at commas.
ls_func_split_full = false # true/false
# Whether to split lines as close to code_width as possible and ignore some
# groupings.
ls_code_width = false # true/false
#
# Code alignment options (not left column spaces/tabs)
#
# Whether to keep non-indenting tabs.
align_keep_tabs = false # true/false
# Whether to use tabs for aligning.
align_with_tabs = false # true/false
# Whether to bump out to the next tab when aligning.
align_on_tabstop = false # true/false
# Whether to right-align numbers.
align_number_right = false # true/false
# Whether to keep whitespace not required for alignment.
align_keep_extra_space = false # true/false
# Whether to align variable definitions in prototypes and functions.
align_func_params = false # true/false
# The span for aligning parameter definitions in function on parameter name.
#
# 0 = Don't align (default).
align_func_params_span = 0 # unsigned number
# The threshold for aligning function parameter definitions.
#
# 0 = No limit (default).
align_func_params_thresh = 0 # unsigned number
# The gap for aligning function parameter definitions.
align_func_params_gap = 0 # unsigned number
# Whether to align parameters in single-line functions that have the same
# name. The function names must already be aligned with each other.
align_same_func_call_params = false # true/false
# The span for aligning function-call parameters for single line functions.
#
# 0 = Don't align (default).
align_same_func_call_params_span = 0 # unsigned number
# The threshold for aligning function-call parameters for single line
# functions.
#
# 0 = No limit (default).
align_same_func_call_params_thresh = 0 # unsigned number
# The span for aligning variable definitions.
#
# 0 = Don't align (default).
align_var_def_span = 0 # unsigned number
# How to align the '*' in variable definitions.
#
# 0: Part of the type 'void * foo;' (default)
# 1: Part of the variable 'void *foo;'
# 2: Dangling 'void *foo;'
align_var_def_star_style = 0 # unsigned number
# How to align the '&' in variable definitions.
#
# 0: Part of the type 'long & foo;' (default)
# 1: Part of the variable 'long &foo;'
# 2: Dangling 'long &foo;'
align_var_def_amp_style = 0 # unsigned number
# The threshold for aligning variable definitions.
#
# 0 = No limit (default).
align_var_def_thresh = 0 # unsigned number
# The gap for aligning variable definitions.
align_var_def_gap = 0 # unsigned number
# Whether to align the colon in struct bit fields.
align_var_def_colon = false # true/false
# The gap for aligning the colon in struct bit fields.
align_var_def_colon_gap = 0 # unsigned number
# Whether to align any attribute after the variable name.
align_var_def_attribute = false # true/false
# Whether to align inline struct/enum/union variable definitions.
align_var_def_inline = false # true/false
# The span for aligning on '=' in assignments.
#
# 0 = Don't align (default).
align_assign_span = 0 # unsigned number
# The threshold for aligning on '=' in assignments.
#
# 0 = No limit (default).
align_assign_thresh = 0 # unsigned number
# How to apply align_assign_span to function declaration "assignments", i.e.
# 'virtual void foo() = 0' or '~foo() = {default|delete}'.
#
# 0: Align with other assignments (default)
# 1: Align with each other, ignoring regular assignments
# 2: Don't align
align_assign_decl_func = 0 # unsigned number
# The span for aligning on '=' in enums.
#
# 0 = Don't align (default).
align_enum_equ_span = 0 # unsigned number
# The threshold for aligning on '=' in enums.
#
# 0 = no limit (default).
align_enum_equ_thresh = 0 # unsigned number
# The span for aligning class member definitions.
#
# 0 = Don't align (default).
align_var_class_span = 0 # unsigned number
# The threshold for aligning class member definitions.
#
# 0 = No limit (default).
align_var_class_thresh = 0 # unsigned number
# The gap for aligning class member definitions.
align_var_class_gap = 0 # unsigned number
# The span for aligning struct/union member definitions.
#
# 0 = Don't align (default).
align_var_struct_span = 0 # unsigned number
# The threshold for aligning struct/union member definitions.
#
# 0 = No limit (default).
align_var_struct_thresh = 0 # unsigned number
# The gap for aligning struct/union member definitions.
align_var_struct_gap = 0 # unsigned number
# The span for aligning struct initializer values.
#
# 0 = Don't align (default).
align_struct_init_span = 0 # unsigned number
# The minimum space between the type and the synonym of a typedef.
align_typedef_gap = 0 # unsigned number
# The span for aligning single-line typedefs.
#
# 0 = Don't align (default).
align_typedef_span = 0 # unsigned number
# How to align typedef'd functions with other typedefs.
#
# 0: Don't mix them at all (default)
# 1: Align the open parenthesis with the types
# 2: Align the function type name with the other type names
align_typedef_func = 0 # unsigned number
# How to align the '*' in typedefs.
#
# 0: Align on typedef type, ignore '*' (default)
# 1: The '*' is part of type name: 'typedef int *pint;'
# 2: The '*' is part of the type, but dangling: 'typedef int *pint;'
align_typedef_star_style = 0 # unsigned number
# How to align the '&' in typedefs.
#
# 0: Align on typedef type, ignore '&' (default)
# 1: The '&' is part of type name: 'typedef int &pint;'
# 2: The '&' is part of the type, but dangling: 'typedef int &pint;'
align_typedef_amp_style = 0 # unsigned number
# The span for aligning comments that end lines.
#
# 0 = Don't align (default).
align_right_cmt_span = 0 # unsigned number
# If aligning comments, whether to mix with comments after '}' and #endif with
# less than three spaces before the comment.
align_right_cmt_mix = false # true/false
# Whether to only align trailing comments that are at the same brace level.
align_right_cmt_same_level = false # true/false
# Minimum number of columns between preceding text and a trailing comment in
# order for the comment to qualify for being aligned. Must be non-zero to have
# an effect.
align_right_cmt_gap = 0 # unsigned number
# Minimum column at which to align trailing comments. Comments which are
# aligned beyond this column, but which can be aligned in a lesser column,
# may be "pulled in".
#
# 0 = Ignore (default).
align_right_cmt_at_col = 0 # unsigned number
# The span for aligning function prototypes.
#
# 0 = Don't align (default).
align_func_proto_span = 0 # unsigned number
# Minimum gap between the return type and the function name.
align_func_proto_gap = 0 # unsigned number
# Whether to align function prototypes on the 'operator' keyword instead of
# what follows.
align_on_operator = false # true/false
# Whether to mix aligning prototype and variable declarations. If true,
# align_var_def_XXX options are used instead of align_func_proto_XXX options.
align_mix_var_proto = false # true/false
# Whether to align single-line functions with function prototypes.
# Uses align_func_proto_span.
align_single_line_func = false # true/false
# Whether to align the open brace of single-line functions.
# Requires align_single_line_func=true. Uses align_func_proto_span.
align_single_line_brace = false # true/false
# Gap for align_single_line_brace.
align_single_line_brace_gap = 0 # unsigned number
# (OC) The span for aligning Objective-C message specifications.
#
# 0 = Don't align (default).
align_oc_msg_spec_span = 0 # unsigned number
# Whether to align macros wrapped with a backslash and a newline. This will
# not work right if the macro contains a multi-line comment.
align_nl_cont = false # true/false
# Whether to align macro functions and variables together.
align_pp_define_together = false # true/false
# The minimum space between label and value of a preprocessor define.
align_pp_define_gap = 0 # unsigned number
# The span for aligning on '#define' bodies.
#
# =0: Don't align (default)
# >0: Number of lines (including comments) between blocks
align_pp_define_span = 0 # unsigned number
# Whether to align lines that start with '<<' with previous '<<'.
#
# Default: true
align_left_shift = true # true/false
# Whether to align text after 'asm volatile ()' colons.
align_asm_colon = false # true/false
# (OC) Span for aligning parameters in an Objective-C message call
# on the ':'.
#
# 0 = Don't align.
align_oc_msg_colon_span = 0 # unsigned number
# (OC) Whether to always align with the first parameter, even if it is too
# short.
align_oc_msg_colon_first = false # true/false
# (OC) Whether to align parameters in an Objective-C '+' or '-' declaration
# on the ':'.
align_oc_decl_colon = false # true/false
#
# Comment modification options
#
# Try to wrap comments at N columns.
cmt_width = 0 # unsigned number
# How to reflow comments.
#
# 0: No reflowing (apart from the line wrapping due to cmt_width) (default)
# 1: No touching at all
# 2: Full reflow
cmt_reflow_mode = 0 # unsigned number
# Whether to convert all tabs to spaces in comments. If false, tabs in
# comments are left alone, unless used for indenting.
cmt_convert_tab_to_spaces = false # true/false
# Whether to apply changes to multi-line comments, including cmt_width,
# keyword substitution and leading chars.
#
# Default: true
cmt_indent_multi = true # true/false
# Whether to group c-comments that look like they are in a block.
cmt_c_group = false # true/false
# Whether to put an empty '/*' on the first line of the combined c-comment.
cmt_c_nl_start = false # true/false
# Whether to add a newline before the closing '*/' of the combined c-comment.
cmt_c_nl_end = false # true/false
# Whether to change cpp-comments into c-comments.
cmt_cpp_to_c = false # true/false
# Whether to group cpp-comments that look like they are in a block. Only
# meaningful if cmt_cpp_to_c=true.
cmt_cpp_group = false # true/false
# Whether to put an empty '/*' on the first line of the combined cpp-comment
# when converting to a c-comment.
#
# Requires cmt_cpp_to_c=true and cmt_cpp_group=true.
cmt_cpp_nl_start = false # true/false
# Whether to add a newline before the closing '*/' of the combined cpp-comment
# when converting to a c-comment.
#
# Requires cmt_cpp_to_c=true and cmt_cpp_group=true.
cmt_cpp_nl_end = false # true/false
# Whether to put a star on subsequent comment lines.
cmt_star_cont = false # true/false
# The number of spaces to insert at the start of subsequent comment lines.
cmt_sp_before_star_cont = 0 # unsigned number
# The number of spaces to insert after the star on subsequent comment lines.
cmt_sp_after_star_cont = 0 # unsigned number
# For multi-line comments with a '*' lead, remove leading spaces if the first
# and last lines of the comment are the same length.
#
# Default: true
cmt_multi_check_last = true # true/false
# For multi-line comments with a '*' lead, remove leading spaces if the first
# and last lines of the comment are the same length AND if the length is
# bigger as the first_len minimum.
#
# Default: 4
cmt_multi_first_len_minimum = 4 # unsigned number
# Path to a file that contains text to insert at the beginning of a file if
# the file doesn't start with a C/C++ comment. If the inserted text contains
# '$(filename)', that will be replaced with the current file's name.
cmt_insert_file_header = "" # string
# Path to a file that contains text to insert at the end of a file if the
# file doesn't end with a C/C++ comment. If the inserted text contains
# '$(filename)', that will be replaced with the current file's name.
cmt_insert_file_footer = "" # string
# Path to a file that contains text to insert before a function definition if
# the function isn't preceded by a C/C++ comment. If the inserted text
# contains '$(function)', '$(javaparam)' or '$(fclass)', these will be
# replaced with, respectively, the name of the function, the javadoc '@param'
# and '@return' stuff, or the name of the class to which the member function
# belongs.
cmt_insert_func_header = "" # string
# Path to a file that contains text to insert before a class if the class
# isn't preceded by a C/C++ comment. If the inserted text contains '$(class)',
# that will be replaced with the class name.
cmt_insert_class_header = "" # string
# Path to a file that contains text to insert before an Objective-C message
# specification, if the method isn't preceded by a C/C++ comment. If the
# inserted text contains '$(message)' or '$(javaparam)', these will be
# replaced with, respectively, the name of the function, or the javadoc
# '@param' and '@return' stuff.
cmt_insert_oc_msg_header = "" # string
# Whether a comment should be inserted if a preprocessor is encountered when
# stepping backwards from a function name.
#
# Applies to cmt_insert_oc_msg_header, cmt_insert_func_header and
# cmt_insert_class_header.
cmt_insert_before_preproc = false # true/false
# Whether a comment should be inserted if a function is declared inline to a
# class definition.
#
# Applies to cmt_insert_func_header.
#
# Default: true
cmt_insert_before_inlines = true # true/false
# Whether a comment should be inserted if the function is a class constructor
# or destructor.
#
# Applies to cmt_insert_func_header.
cmt_insert_before_ctor_dtor = false # true/false
#
# Code modifying options (non-whitespace)
#
# Add or remove braces on a single-line 'do' statement.
mod_full_brace_do = ignore # ignore/add/remove/force
# Add or remove braces on a single-line 'for' statement.
mod_full_brace_for = ignore # ignore/add/remove/force
# (Pawn) Add or remove braces on a single-line function definition.
mod_full_brace_function = ignore # ignore/add/remove/force
# Add or remove braces on a single-line 'if' statement. Braces will not be
# removed if the braced statement contains an 'else'.
mod_full_brace_if = ignore # ignore/add/remove/force
# Whether to enforce that all blocks of an 'if'/'else if'/'else' chain either
# have, or do not have, braces. If true, braces will be added if any block
# needs braces, and will only be removed if they can be removed from all
# blocks.
#
# Overrides mod_full_brace_if.
mod_full_brace_if_chain = false # true/false
# Whether to add braces to all blocks of an 'if'/'else if'/'else' chain.
# If true, mod_full_brace_if_chain will only remove braces from an 'if' that
# does not have an 'else if' or 'else'.
mod_full_brace_if_chain_only = false # true/false
# Add or remove braces on single-line 'while' statement.
mod_full_brace_while = ignore # ignore/add/remove/force
# Add or remove braces on single-line 'using ()' statement.
mod_full_brace_using = ignore # ignore/add/remove/force
# Don't remove braces around statements that span N newlines
mod_full_brace_nl = 0 # unsigned number
# Whether to prevent removal of braces from 'if'/'for'/'while'/etc. blocks
# which span multiple lines.
#
# Affects:
# mod_full_brace_for
# mod_full_brace_if
# mod_full_brace_if_chain
# mod_full_brace_if_chain_only
# mod_full_brace_while
# mod_full_brace_using
#
# Does not affect:
# mod_full_brace_do
# mod_full_brace_function
mod_full_brace_nl_block_rem_mlcond = false # true/false
# Add or remove unnecessary parenthesis on 'return' statement.
mod_paren_on_return = ignore # ignore/add/remove/force
# (Pawn) Whether to change optional semicolons to real semicolons.
mod_pawn_semicolon = false # true/false
# Whether to fully parenthesize Boolean expressions in 'while' and 'if'
# statement, as in 'if (a && b > c)' → 'if (a && (b > c))'.
mod_full_paren_if_bool = false # true/false
# Whether to remove superfluous semicolons.
mod_remove_extra_semicolon = false # true/false
# If a function body exceeds the specified number of newlines and doesn't have
# a comment after the close brace, a comment will be added.
mod_add_long_function_closebrace_comment = 0 # unsigned number
# If a namespace body exceeds the specified number of newlines and doesn't
# have a comment after the close brace, a comment will be added.
mod_add_long_namespace_closebrace_comment = 0 # unsigned number
# If a class body exceeds the specified number of newlines and doesn't have a
# comment after the close brace, a comment will be added.
mod_add_long_class_closebrace_comment = 0 # unsigned number
# If a switch body exceeds the specified number of newlines and doesn't have a
# comment after the close brace, a comment will be added.
mod_add_long_switch_closebrace_comment = 0 # unsigned number
# If an #ifdef body exceeds the specified number of newlines and doesn't have
# a comment after the #endif, a comment will be added.
mod_add_long_ifdef_endif_comment = 0 # unsigned number
# If an #ifdef or #else body exceeds the specified number of newlines and
# doesn't have a comment after the #else, a comment will be added.
mod_add_long_ifdef_else_comment = 0 # unsigned number
# Whether to sort consecutive single-line 'import' statements.
mod_sort_import = false # true/false
# (C#) Whether to sort consecutive single-line 'using' statements.
mod_sort_using = false # true/false
# Whether to sort consecutive single-line '#include' statements (C/C++) and
# '#import' statements (Objective-C). Be aware that this has the potential to
# break your code if your includes/imports have ordering dependencies.
mod_sort_include = false # true/false
# Whether to move a 'break' that appears after a fully braced 'case' before
# the close brace, as in 'case X: { ... } break;' → 'case X: { ... break; }'.
mod_move_case_break = false # true/false
# Add or remove braces around a fully braced case statement. Will only remove
# braces if there are no variable declarations in the block.
mod_case_brace = ignore # ignore/add/remove/force
# Whether to remove a void 'return;' that appears as the last statement in a
# function.
mod_remove_empty_return = false # true/false
# Add or remove the comma after the last value of an enumeration.
mod_enum_last_comma = ignore # ignore/add/remove/force
# (OC) Whether to organize the properties. If true, properties will be
# rearranged according to the mod_sort_oc_property_*_weight factors.
mod_sort_oc_properties = false # true/false
# (OC) Weight of a class property modifier.
mod_sort_oc_property_class_weight = 0 # number
# (OC) Weight of 'atomic' and 'nonatomic'.
mod_sort_oc_property_thread_safe_weight = 0 # number
# (OC) Weight of 'readwrite' when organizing properties.
mod_sort_oc_property_readwrite_weight = 0 # number
# (OC) Weight of a reference type specifier ('retain', 'copy', 'assign',
# 'weak', 'strong') when organizing properties.
mod_sort_oc_property_reference_weight = 0 # number
# (OC) Weight of getter type ('getter=') when organizing properties.
mod_sort_oc_property_getter_weight = 0 # number
# (OC) Weight of setter type ('setter=') when organizing properties.
mod_sort_oc_property_setter_weight = 0 # number
# (OC) Weight of nullability type ('nullable', 'nonnull', 'null_unspecified',
# 'null_resettable') when organizing properties.
mod_sort_oc_property_nullability_weight = 0 # number
#
# Preprocessor options
#
# Add or remove indentation of preprocessor directives inside #if blocks
# at brace level 0 (file-level).
pp_indent = ignore # ignore/add/remove/force
# Whether to indent #if/#else/#endif at the brace level. If false, these are
# indented from column 1.
pp_indent_at_level = false # true/false
# Specifies the number of columns to indent preprocessors per level
# at brace level 0 (file-level). If pp_indent_at_level=false, also specifies
# the number of columns to indent preprocessors per level
# at brace level > 0 (function-level).
#
# Default: 1
pp_indent_count = 1 # unsigned number
# Add or remove space after # based on pp_level of #if blocks.
pp_space = ignore # ignore/add/remove/force
# Sets the number of spaces per level added with pp_space.
pp_space_count = 0 # unsigned number
# The indent for '#region' and '#endregion' in C# and '#pragma region' in
# C/C++. Negative values decrease indent down to the first column.
pp_indent_region = 0 # number
# Whether to indent the code between #region and #endregion.
pp_region_indent_code = false # true/false
# If pp_indent_at_level=true, sets the indent for #if, #else and #endif when
# not at file-level. Negative values decrease indent down to the first column.
#
# =0: Indent preprocessors using output_tab_size
# >0: Column at which all preprocessors will be indented
pp_indent_if = 0 # number
# Whether to indent the code between #if, #else and #endif.
pp_if_indent_code = false # true/false
# Whether to indent '#define' at the brace level. If false, these are
# indented from column 1.
pp_define_at_level = false # true/false
# Whether to ignore the '#define' body while formatting.
pp_ignore_define_body = false # true/false
# Whether to indent case statements between #if, #else, and #endif.
# Only applies to the indent of the preprocesser that the case statements
# directly inside of.
#
# Default: true
pp_indent_case = true # true/false
# Whether to indent whole function definitions between #if, #else, and #endif.
# Only applies to the indent of the preprocesser that the function definition
# is directly inside of.
#
# Default: true
pp_indent_func_def = true # true/false
# Whether to indent extern C blocks between #if, #else, and #endif.
# Only applies to the indent of the preprocesser that the extern block is
# directly inside of.
#
# Default: true
pp_indent_extern = true # true/false
# Whether to indent braces directly inside #if, #else, and #endif.
# Only applies to the indent of the preprocesser that the braces are directly
# inside of.
#
# Default: true
pp_indent_brace = true # true/false
#
# Sort includes options
#
# The regex for include category with priority 0.
include_category_0 = "" # string
# The regex for include category with priority 1.
include_category_1 = "" # string
# The regex for include category with priority 2.
include_category_2 = "" # string
#
# Use or Do not Use options
#
# true: indent_func_call_param will be used (default)
# false: indent_func_call_param will NOT be used
#
# Default: true
use_indent_func_call_param = true # true/false
# The value of the indentation for a continuation line is calculated
# differently if the statement is:
# - a declaration: your case with QString fileName ...
# - an assignment: your case with pSettings = new QSettings( ...
#
# At the second case the indentation value might be used twice:
# - at the assignment
# - at the function call (if present)
#
# To prevent the double use of the indentation value, use this option with the
# value 'true'.
#
# true: indent_continue will be used only once
# false: indent_continue will be used every time (default)
use_indent_continue_only_once = false # true/false
# The value might be used twice:
# - at the assignment
# - at the opening brace
#
# To prevent the double use of the indentation value, use this option with the
# value 'true'.
#
# true: indentation will be used only once
# false: indentation will be used every time (default)
indent_cpp_lambda_only_once = false # true/false
# Whether to apply special formatting for Qt SIGNAL/SLOT macros. Essentially,
# this tries to format these so that they match Qt's normalized form (i.e. the
# result of QMetaObject::normalizedSignature), which can slightly improve the
# performance of the QObject::connect call, rather than how they would
# otherwise be formatted.
#
# See options_for_QT.cpp for details.
#
# Default: true
use_options_overriding_for_qt_macros = true # true/false
#
# Warn levels - 1: error, 2: warning (default), 3: note
#
# (C#) Warning is given if doing tab-to-\t replacement and we have found one
# in a C# verbatim string literal.
#
# Default: 2
warn_level_tabs_found_in_verbatim_string_literals = 2 # unsigned number
# Meaning of the settings:
# Ignore - do not do any changes
# Add - makes sure there is 1 or more space/brace/newline/etc
# Force - makes sure there is exactly 1 space/brace/newline/etc,
# behaves like Add in some contexts
# Remove - removes space/brace/newline/etc
#
#
# - Token(s) can be treated as specific type(s) with the 'set' option:
# `set tokenType tokenString [tokenString...]`
#
# Example:
# `set BOOL __AND__ __OR__`
#
# tokenTypes are defined in src/token_enum.h, use them without the
# 'CT_' prefix: 'CT_BOOL' → 'BOOL'
#
#
# - Token(s) can be treated as type(s) with the 'type' option.
# `type tokenString [tokenString...]`
#
# Example:
# `type int c_uint_8 Rectangle`
#
# This can also be achieved with `set TYPE int c_uint_8 Rectangle`
#
#
# To embed whitespace in tokenStrings use the '\' escape character, or quote
# the tokenStrings. These quotes are supported: "'`
#
#
# - Support for the auto detection of languages through the file ending can be
# added using the 'file_ext' command.
# `file_ext langType langString [langString..]`
#
# Example:
# `file_ext CPP .ch .cxx .cpp.in`
#
# langTypes are defined in uncrusify_types.h in the lang_flag_e enum, use
# them without the 'LANG_' prefix: 'LANG_CPP' → 'CPP'
#
#
# - Custom macro-based indentation can be set up using 'macro-open',
# 'macro-else' and 'macro-close'.
# `(macro-open | macro-else | macro-close) tokenString`
#
# Example:
# `macro-open BEGIN_TEMPLATE_MESSAGE_MAP`
# `macro-open BEGIN_MESSAGE_MAP`
# `macro-close END_MESSAGE_MAP`
#
#
# option(s) with 'not default' value: 0
#
#
# uncrustify config file for objective-c and objective-c++
#
indent_with_tabs = 0 # 1=indent to level only, 2=indent with tabs
output_tab_size = 4 # new tab size
indent_columns = output_tab_size
indent_label = 2 # pos: absolute col, neg: relative column
indent_align_assign = FALSE
#
# Indenting
#
# indent_brace = 0
indent_switch_case = indent_columns
#
# Inter-symbol newlines
#
nl_enum_brace = remove # "enum {" vs "enum \n {"
nl_union_brace = remove # "union {" vs "union \n {"
nl_struct_brace = remove # "struct {" vs "struct \n {"
nl_do_brace = remove # "do {" vs "do \n {"
nl_if_brace = remove # "if () {" vs "if () \n {"
nl_for_brace = remove # "for () {" vs "for () \n {"
nl_else_brace = remove # "else {" vs "else \n {"
nl_while_brace = remove # "while () {" vs "while () \n {"
nl_switch_brace = remove # "switch () {" vs "switch () \n {"
nl_brace_while = remove # "} while" vs "} \n while" - cuddle while
nl_brace_else = remove # "} else" vs "} \n else" - cuddle else
nl_func_var_def_blk = 1
nl_fcall_brace = remove # "list_for_each() {" vs "list_for_each()\n{"
nl_fdef_brace = remove # "int foo() {" vs "int foo()\n{"
# nl_after_return = TRUE;
# nl_before_case = 1
#
# Source code modifications
#
mod_paren_on_return = ignore # "return 1;" vs "return (1);"
mod_full_brace_if = ignore # "if (a) a--;" vs "if (a) { a--; }"
mod_full_brace_for = add # "for () a--;" vs "for () { a--; }"
mod_full_brace_do = ignore # "do a--; while ();" vs "do { a--; } while ();"
mod_full_brace_while = remove # "while (a) a--;" vs "while (a) { a--; }"
mod_full_brace_nl = 3 # don't remove if more than 3 newlines
mod_add_long_ifdef_endif_comment = 16
mod_add_long_ifdef_else_comment = mod_add_long_ifdef_endif_comment
mod_add_long_switch_closebrace_comment = mod_add_long_ifdef_endif_comment
mod_add_long_function_closebrace_comment = mod_add_long_ifdef_endif_comment
#
# Inter-character spacing options
#
# sp_return_paren = force # "return (1);" vs "return(1);"
sp_sizeof_paren = remove # "sizeof (int)" vs "sizeof(int)"
sp_before_sparen = force # "if (" vs "if("
sp_after_sparen = force # "if () {" vs "if (){"
sp_after_cast = remove # "(int) a" vs "(int)a"
sp_inside_braces = add # "{ 1 }" vs "{1}"
sp_inside_braces_struct = add # "{ 1 }" vs "{1}"
sp_inside_braces_enum = add # "{ 1 }" vs "{1}"
sp_inside_fparen = remove # "func( param )" vs "func(param)"
sp_paren_brace = force
sp_assign = add
sp_arith = add
sp_bool = add
sp_compare = add
sp_after_comma = add
sp_func_def_paren = remove # "int foo (){" vs "int foo(){"
sp_func_call_paren = remove # "foo (" vs "foo("
sp_func_proto_paren = remove # "int foo ();" vs "int foo();"
sp_before_ptr_star = force
sp_after_ptr_star = force
sp_before_unnamed_ptr_star = ignore
sp_between_ptr_star = remove
sp_after_ptr_star_func = force
sp_before_ptr_star_func = force
sp_cmt_cpp_start = add
sp_cond_question = force
sp_cond_colon = force
sp_else_brace = force
sp_brace_else = force
sp_after_class_colon = force
sp_before_class_colon = force
sp_before_case_colon = remove
# Objective-C specifics
sp_before_oc_colon = remove
sp_after_oc_colon = remove
sp_after_oc_scope = force
sp_after_oc_type = remove
sp_after_oc_return_type = force
sp_before_send_oc_colon = remove
sp_after_send_oc_colon = remove
sp_after_oc_at_sel = remove
sp_before_oc_block_caret = ignore
sp_after_oc_block_caret = remove
#
# Aligning stuff
#
align_with_tabs = False # use tabs to align
align_on_tabstop = False # align on tabstops
# align_keep_tabs = True
align_enum_equ_span = 4 # '=' in enum definition
# align_nl_cont = True
# align_var_def_span = 2
# align_var_def_inline = True
# align_var_def_star = False
# align_var_def_colon = True
# align_assign_span = 1
align_struct_init_span = 4 # align stuff in a structure init '= { }'
align_right_cmt_span = 8
align_right_cmt_gap = 8
align_pp_define_span = 8
#align_pp_define_gap = 8
align_oc_msg_colon_span = 1 # align parameters in an Obj-C message on the ':' but stop after this many lines (0=don't align)
align_oc_msg_spec_span = 0 # the span for aligning ObjC msg spec (0=don't align)
#
# Line Splitting options
#
# ls_func_split_full = True # Whether to fully split long function protos/calls at commas
#
# Comment modifications
#
cmt_star_cont = True # Whether to put a star on subsequent comment lines
[style]
# Predefined styles set: pep8, chromium, google, facebook
based_on_style = pep8
# 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=False
# Allow lambdas to be formatted on more than one line.
allow_multiline_lambdas=False
# Allow splits before the dictionary value.
allow_split_before_dict_value=True
# Number of blank lines surrounding top-level function and class
# definitions.
blank_lines_around_top_level_definition=2
# Insert a blank line before a class-level docstring.
blank_line_before_class_docstring=False
# Insert a blank line before a module docstring.
blank_line_before_module_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=False
# 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=False
# The column limit.
column_limit=79
# The style for continuation alignment. Possible values are:
#
# - SPACE: Use spaces for continuation alignment. This is default behavior.
# - FIXED: Use fixed number (CONTINUATION_INDENT_WIDTH) of columns
# (ie: CONTINUATION_INDENT_WIDTH/INDENT_WIDTH tabs) for continuation
# alignment.
# - LESS: Slightly left if cannot vertically align continuation lines with
# indent characters.
# - VALIGN-RIGHT: Vertically align continuation lines with indent
# characters. Slightly right (one more indent character) if cannot
# vertically align continuation lines with indent characters.
#
# For options FIXED, and VALIGN-RIGHT are only available when USE_TABS is
# enabled.
continuation_align_style=SPACE
# Indent width used for line continuations.
continuation_indent_width=4
# 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
# Disable the heuristic which places each list element on a separate line
# if the list is comma-terminated.
disable_ending_comma_heuristic=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 blank lines.
indent_blank_lines=False
# 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=False
# 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
# Do not include spaces around selected binary operators. For example:
#
# 1 + 2 * 3 - 4 / 5
#
# will be formatted as follows when configured with "*,/":
#
# 1 + 2*3 - 4/5
#
no_spaces_around_selected_binary_operators=
# 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
split_all_comma_separated_values=False
# 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=True
# Split before the closing bracket if a list or dict literal doesn't fit on
# a single line.
split_before_closing_bracket=True
# 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
# Split before the '.' if we need to split a longer expression:
#
# foo = ('This is a really long string: {}, {}, {}, {}'.format(a, b, c, d))
#
# would reformat to something like:
#
# foo = ('This is a really long string: {}, {}, {}, {}'
# .format(a, b, c, d))
split_before_dot=False
# Split after the opening paren which surrounds an expression if it doesn't
# fit on a single line.
split_before_expression_after_opening_paren=False
# 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=True
# Split named assignments onto individual lines.
split_before_named_assigns=True
# Set to True to split list comprehensions and generators that have
# non-trivial expressions and multiple clauses before each of these
# clauses. For example:
#
# result = [
# a_long_var + 100 for a_long_var in xrange(1000)
# if a_long_var % 10]
#
# would reformat to something like:
#
# result = [
# a_long_var + 100
# for a_long_var in xrange(1000)
# if a_long_var % 10]
split_complex_comprehension=False
# The penalty for splitting right after the opening bracket.
split_penalty_after_opening_bracket=30
# 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 splitting a list comprehension or generator
# expression.
split_penalty_comprehension=80
# The penalty for characters over the column limit.
split_penalty_excess_character=7000
# 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=30
# 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
{
"debug": false,
"show_statusbar": true,
"environ": {
"PATH": [],
"GEM_PATH": ["${packages}/User/formatter.assets/ruby"],
"PYTHONPATH": [
"${packages}/User/formatter.assets/python/lib/python3.7/site-packages"
]
},
"formatters": {
"rustfmt": {
"disable": false,
"format_on_save": false,
"syntaxes": ["rust", "Rust", "RustEnhanced"],
// "executable_path": "/Users/wm/.cargo/bin/rustfmt",
"executable_path": "rustfmt",
},
"beautysh": {
"disable": false,
"format_on_save": false,
"syntaxes": ["bash"],
"executable_path": "${packages}/User/formatter.assets/python/bin/beautysh",
"config_path": {
"default": "${packages}/User/formatter.assets/config/beautyshrc.json"
}
},
"black": {
"disable": false,
"format_on_save": false,
"syntaxes": ["python"],
"executable_path": "${packages}/User/formatter.assets/python/bin/black",
"config_path": {
"default": "${packages}/User/formatter.assets/config/blackrc.toml"
}
},
"clangformat": {
"disable": false,
"format_on_save": false,
"syntaxes": ["c", "c++", "objc", "objc++", "js", "java", "proto"],
"executable_path": "${packages}/User/formatter.assets/bin/clang-format",
"config_path": {
"default": "${packages}/User/formatter.assets/config/clangformatrc.yaml"
}
},
"csscomb": {
"disable": false,
"format_on_save": false,
"syntaxes": ["css", "scss", "sass", "less"],
"executable_path": "${packages}/User/formatter.assets/javascript/node_modules/.bin/csscomb",
"config_path": {
"default": "${packages}/User/formatter.assets/config/csscombrc.json"
}
},
"eslint": {
"disable": false,
"format_on_save": false,
"syntaxes": ["js"],
"executable_path": "${packages}/User/formatter.assets/javascript/node_modules/.bin/eslint",
"config_path": {
"default": "${packages}/User/formatter.assets/config/eslintrc.json"
}
},
"htmltidy": {
"disable": true,
"format_on_save": false,
"syntaxes": ["html", "xml"],
"executable_path": "${packages}/User/formatter.assets/bin/tidy",
"config_path": {
"html": "${packages}/User/formatter.assets/config/htmltidyrc_html.cfg",
"xml": "${packages}/User/formatter.assets/config/htmltidyrc_xml.cfg"
}
},
"jsbeautifier": {
"disable": true,
"format_on_save": false,
"syntaxes": ["js", "css", "html", "json"],
"executable_path": "${packages}/User/formatter.assets/javascript/node_modules/.bin/js-beautify",
"config_path": {
"default": "${packages}/User/formatter.assets/config/jsbeautifyrc.json"
}
},
"jsonmax": {
"disable": true,
"format_on_save": false,
"syntaxes": ["json"],
"config_path": {
"default": "${packages}/User/formatter.assets/config/jsonmaxrc.json"
}
},
"perltidy": {
"disable": false,
"format_on_save": false,
"syntaxes": ["perl"],
"executable_path": "${packages}/User/formatter.assets/bin/perltidy",
"config_path": {
"default": "${packages}/User/formatter.assets/config/perltidyrc.cfg"
}
},
"phpcsfixer": {
"disable": false,
"format_on_save": false,
"syntaxes": ["php"],
"executable_path": "${packages}/User/formatter.assets/bin/php-cs-fixer-v2.phar",
"config_path": {
"default": "${packages}/User/formatter.assets/config/phpcsfixerrc.php"
}
},
"prettier": {
"disable": false,
"format_on_save": false,
"syntaxes": [
"css",
"scss",
"less",
"js",
"jsx",
"json",
"json",
"html",
"graphql",
"markdown",
"toml",
"tsx",
"vue",
"yaml"
],
"executable_path": "${packages}/User/formatter.assets/javascript/node_modules/.bin/prettier",
"config_path": {
// "default": "${packages}/User/formatter.assets/config/prettierrc.json",
"toml": "${packages}/User/formatter.assets/config/prettierrc.toml.json"
}
},
"rubocop": {
"disable": false,
"format_on_save": false,
"syntaxes": ["ruby"],
"executable_path": "${packages}/User/formatter.assets/ruby/bin/rubocop",
"config_path": {
"default": "${packages}/User/formatter.assets/config/rubocoprc.yml"
}
},
"stylelint": {
"disable": true,
"format_on_save": false,
"syntaxes": ["css", "scss", "sass", "less", "sss", "sugarss"],
"executable_path": "${packages}/User/formatter.assets/javascript/node_modules/.bin/stylelint",
"args": [
"--config-basedir",
"${packages}/User/formatter.assets/javascript/node_modules"
],
"config_path": {
"default": "${packages}/User/formatter.assets/config/stylelintrc.json"
}
},
"uncrustify": {
"disable": true,
"format_on_save": false,
"syntaxes": [
"c",
"c++",
"cs",
"objc",
"objc++",
"d",
"java",
"pawn",
"vala"
],
"executable_path": "${packages}/User/formatter.assets/bin/uncrustify",
"config_path": {
"objc": "${packages}/User/formatter.assets/config/uncrustifyrc_objc.cfg",
"default": "${packages}/User/formatter.assets/config/uncrustifyrc.cfg"
}
},
"yapf": {
"disable": false,
"format_on_save": false,
"syntaxes": ["python"],
"executable_path": "${packages}/User/formatter.assets/python/bin/yapf",
"config_path": {
"default": "${packages}/User/formatter.assets/config/yapfrc.yapf"
}
},
"cleancss": {
"disable": true,
"format_on_save": false,
"syntaxes": ["css", "scss", "sass", "less"],
"executable_path": "${packages}/User/formatter.assets/javascript/node_modules/.bin/cleancss",
"config_path": {
"default": "${packages}/User/formatter.assets/config/cleancssrc.json"
}
},
"htmlminifier": {
"disable": true,
"format_on_save": false,
"syntaxes": ["html", "xml"],
"executable_path": "${packages}/User/formatter.assets/javascript/node_modules/.bin/html-minifier",
"config_path": {
"default": "${packages}/User/formatter.assets/config/htmlminifierrc.json"
}
},
"jsonmin": {
"disable": true,
"format_on_save": false,
"syntaxes": ["json"]
},
"terser": {
"disable": false,
"format_on_save": false,
"syntaxes": ["js"],
"executable_path": "${packages}/User/formatter.assets/javascript/node_modules/.bin/terser",
"config_path": {
"default": "${packages}/User/formatter.assets/config/terserrc.json"
}
}
}
}
{
"extensions":
[
"cfg",
"service",
"desktop",
"pylintrc"
]
}
// These settings override both User and Default settings for the Git Commit Message syntax
{
"rulers": [50, 72],
}
{ "statusbar_branch": false, "statusbar_status": false }
{
"docs": {
"rust": "https://doc.rust-lang.org/std/index.html?search=%(query)s"
}
}
{
"colors_by_scope": [
"string",
"entity.name.class",
"variable.parameter",
"invalid.deprecated",
"invalid",
"support.function",
"meta.block",
"comment.line.documentation"
],
"whole_word": true,
"permanent_highlight_keyword_color_mappings": [
{
"keyword": "FIXME",
"color": "variable.parameter"
},
{
"keyword": "XXX",
"color": "entity.name.class"
},
{
"keyword": "HACK",
"color": "entity.name.class"
},
{
"keyword": "TODO",
// "color": "support.function",
// "color": "string",
"color": "comment.line.documentation"
}
]
}
{
"extensions":
[
"js"
]
}
{
"extensions":
[
]
}
{
"cmd": ["julia", "$file"],
"selector": "source.julia",
}
{
"auto_show_diagnostics_panel": false,
"clients":
{
"js-langserver":
{
"command":
[
"js-langserver",
"--stdio"
],
"enabled": true,
"languages":
[
{
"languageId": "javascript",
"scopes":
[
"source.js",
"source.jsx"
],
"syntaxes":
[
"Packages/JavaScript/JavaScript.sublime-syntax",
"Packages/Babel/JavaScript (Babel).sublime-syntax"
]
}
]
},
"pyls":
{
"enabled": true
},
"ra-lsp":
{
"enabled": false
},
"rls":
{
"command":
[
"rls"
],
"enabled": true,
"languageId": "rust",
"scopes":
[
"source.rust"
],
"settings":
{
"rust":
{
"all_targets": false,
"cfg_test": true,
"clippy_preference": "opt-in"
}
},
"syntaxes":
[
"Packages/Rust/Rust.sublime-syntax",
"Packages/Rust Enhanced/RustEnhanced.sublime-syntax"
]
},
"typescript-language-server":
{
"command":
[
"typescript-language-server",
"--stdio"
],
"enabled": true,
"languages":
[
{
"languageId": "typescript",
"scopes":
[
"source.ts",
"source.tsx"
],
"syntaxes":
[
"Typescript"
]
}
]
}
},
"log_debug": false,
"log_payloads": false,
"show_code_actions_bulb": true,
"show_diagnostics_count_in_view_status": true,
"show_diagnostics_in_view_status": false,
"show_diagnostics_phantoms": false,
"show_diagnostics_severity_level": 4,
"show_references_in_quick_panel": true
}
{
"globals":
{
"fold_marker": "#5C6370",
},
}
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"A File Icon",
"All Autocomplete",
"Case Conversion",
"CommentFold",
"Comments Aware Enter",
"DictionaryAutoComplete",
"Dockerfile Syntax Highlighting",
"FileSystem Autocompletion",
"fish",
"Fold Comments",
"Formatter",
"Generic Config",
"Git",
"Google Search",
"GotoDocumentation",
"GraphQL",
"HighlightWords",
"LSP",
"MarkdownPreview",
"NeoVintageous",
"One Dark Color Scheme",
"Package Control",
"Rust Enhanced",
"RustFmt",
"SideBarEnhancements",
"Sync Settings",
"Terminal",
"Theme - Spaceblack",
"TOML",
"VimL"
],
"repositories":
[
]
}
// sh -c 'export DIR=$HOME/.config/sublime-text-3/Packages/Default; mkdir -p "$DIR"; cd "$DIR" && ln -s ../User/Preferences\ \(*.sublime-settings .'
{
"font_face": "",
"font_size": 11,
"ignored_packages": ["Vintage", "Six", "Vintageous"]
}
// sh -c 'export DIR=''"$HOME/Library/Application Support/Sublime Text 3/Packages/Default"''; mkdir -p "$DIR"; cd "$DIR" && ln -s ../User/Preferences\ \(*.sublime-settings .'
{
"font_face": "SF Mono",
"font_size": 13,
"ignored_packages": ["Vintage", "Six", "Vintageous", "NeoVintageous"]
}
{
"added_words":
[
"addr",
"clippy",
"https",
"lang",
"html",
"org",
"fn",
"username",
"zxcvbn",
"struct",
"argonautica",
"enum",
"deserialize",
"timestamp",
"i64",
"jwt",
"jsonwebtoken",
"io",
"refactor",
"Utc",
"github",
"auth",
"wikipedia",
"wiki",
"async",
"bool",
"facebook",
"elasticsearch",
"google",
"params",
"config",
"app",
"ok",
"www",
"graphql",
"htm",
"ietf",
"voxjar",
"ty",
"Accessor",
"metadata",
"vec",
"serde",
"serializer",
"pw",
"impl",
"uuid",
"pre",
"sendgrid",
"api",
"env",
"str",
"hardcode",
"popup",
"multiline",
"regex",
"popups",
"minimap",
"onscreen",
"indices",
"blog",
"http",
"v4",
"cfg",
"Voxjar's",
"toml",
"x1",
"json",
"url",
"mozilla",
"hyperium",
"ie",
"reddit",
"rfcs",
"signup",
"iana",
"xhtml",
"",
"localhost",
"dev",
"aggs",
"foo",
"ddns",
"src",
"diff",
"simd",
"platoaiinc",
"md",
"vscode",
"backend",
"args",
"ommitted",
"zipfiles",
"rustup",
"usr",
"cors",
"iter",
"deserialization",
"base64",
"Deserializes",
"param",
"knex",
"todo",
"eslint",
"lodash",
"utils"
],
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
"*.tga",
"*.dds",
"*.ico",
"*.eot",
"*.pdf",
"*.swf",
"*.jar",
"*.zip",
"Cargo.lock",
"package-lock.json",
"*.train.json",
"*.test.json"
],
"color_scheme": "Packages/One Dark Color Scheme/One Dark.tmTheme",
"file_exclude_patterns":
[
"*.pyc",
"*.pyo",
"*.exe",
"*.dll",
"*.obj",
"*.o",
"*.a",
"*.lib",
"*.so",
"*.dylib",
"*.ncb",
"*.sdf",
"*.suo",
"*.pdb",
"*.idb",
".DS_Store",
"*.class",
"*.psd",
"*.db",
"*.sublime-workspace",
"*cache*"
],
"folder_exclude_patterns":
[
".svn",
".git",
".hg",
"CVS",
"node_modules",
"target",
"docs",
".idea",
".vscode",
"*build*",
".cache",
"dist",
"venv",
".venv",
"env",
".env",
".mypy_cache",
"__pycache__",
"*.egg-info"
],
"font_size": 14,
"ignored_packages":
[
"NeoVintageous",
"Six",
"Vintage",
"Vintageous"
],
"ignored_words":
[
"rfc3339",
"rfc5322",
"rfc6750",
"rfc8259",
"v1"
],
"linecomments_alt_enter": true,
"linecomments_ctrl_enter": true,
"linecomments_shift_enter": true,
"linecomments_super_enter": true,
"margin": -2,
"neovintageous_build_version": 11100,
"remember_full_screen": true,
"rulers":
[
80,
100,
120
],
"save_on_focus_lost": false,
"scroll_past_end": false,
"show_panel_on_build": true,
"spaceblack_tabs_normal": true,
"spell_check": false,
"theme": "Spaceblack.sublime-theme",
"trim_trailing_white_space_on_save": true,
"vintageous_reset_mode_when_switching_tabs": false,
"vintageous_use_ctrl_keys": null,
"vintageous_use_super_keys": null,
"vintageous_use_sys_clipboard": true
}
{
"extensions":
[
"py"
],
"translate_tabs_to_spaces": true,
"tab_size": 4
}
{
"cmd": ["./venv/bin/python3", "-u", "$file"],
"selector": "source.python",
"file_regex": "^\\s*File \"(...*?)\", line ([0-9]*)"
}
{
"cmd": [
"fish",
"-c",
"rsync ./ habanero.cs:'~/Documents/developer/$project_base_name' --quiet --exclude=.git/; and ssh habanero.cs 'cd ~/Documents/developer/$project_base_name; and source venv/bin/activate.fish; python3 $file_name'"
],
"selector": "source.python",
"file_regex": "^\\s*File \"(...*?)\", line ([0-9]*)"
}
{
"cmd": ["python3", "-i", "-u", "$file"],
"file_regex": "^[ ]File \"(...?)\", line ([0-9]*)",
"selector": "source.python"
}
{
"cmd": [
"fish",
"-c",
"rsync ./ habanero.cs:'~/Documents/developer/$project_base_name' -vv"
]
}
{
"extensions":
[
]
}
{
"extensions": ["rs"],
"rust_gutter_style": "circle",
"rust_message_status_bar": true,
"rust_phantom_style": "popup",
"rust_region_style": "squiggly_underline",
"rust_syntax_checking": false,
"rust_syntax_checking_include_tests": false,
"rust_syntax_checking_method": "check",
"rust_syntax_hide_warnings": false,
"show_panel_on_build": true,
// "rust_message_status_bar_msg": "Checking"
}
// RustFmt Settings - User
{
"format_on_save": true,
"error_messages": true,
// TODO: fix path to use nightly for this and not the rest of the rust toolchain
"executable": ["/Users/wm/.rustup/toolchains/nightly-x86_64-apple-darwin/bin/rustfmt"]
}
[
{
// Tabs
"class": "tabset_control",
"tab_height": 30,
},
]
{
"terminal": "gnome-terminal",
// "parameters": ["--open-in-tab"]
}
{
"terminal": "iTerm2-v3.sh",
"parameters": ["--open-in-tab"]
}
{
"terminal": "iTerm2-v3.sh",
"parameters": ["--open-in-tab"]
}
{
"extensions":
[
]
}
{
// "trailing_spaces_enabled": false,
"trailing_spaces_include_current_line" : false,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment