# Sudsy: documentation # Getting started > Install Sudsy, check a project without changing it, fix it, configure it, and run it in your editor and in CI. ## 1. Install **npm** ```sh npm i -D @sudsylint/sudsy ``` Run it with `npx sudsy`. **PyPI** ```sh pip install sudsy ``` Or run it without installing: `uvx sudsy`. **Homebrew** ```sh brew install bingsubandit/sudsy/sudsy ``` **Scoop** ```sh scoop bucket add sudsy https://github.com/bingsubandit/scoop-sudsy; scoop install sudsy ``` **Binary** Download the archive for your platform (Linux, macOS or Windows, x64 or arm64) from the [GitHub releases](https://github.com/bingsubandit/sudsy/releases) and put `sudsy` on your `PATH`. To try it first without installing anything: `npx @sudsylint/sudsy check src/` or `uvx sudsy check src/`. ## 2. Check without changing anything The examples use two small files in `src/`: ```python # src/a.py x = os.getcwd() if x == None: print( "hi", sys.argv ) ``` ```js // src/b.js function add(a, b) { debugger; return a+b } ``` ```sh sudsy check src/ ``` ```text src/a.py:1:1: error[format]: the file is not formatted; run `sudsy format` src/a.py:4:4: warning[none-comparison]: compare to None with `is` or `is not`, not `==` or `!=` src/b.js:1:1: error[format]: the file is not formatted; run `sudsy format` src/b.js:2:5: warning[no-debugger]: a call that stops in a debugger was left in the code 2 file(s) checked, 2 error(s), 2 warning(s) ``` A line reads `file:line:column: level[rule]: message`. An `error[format]` means the file is not formatted; a `warning` is a likely bug. `check` changes no files and exits 1 while there is an error. ## 3. Fix it `sudsy format` rewrites the files in the project's style and changes nothing else. `sudsy fix` applies the safe fixes of the rules first, then formats. Findings whose fix could change behavior are reported and left alone. ```sh sudsy format src/ ``` ```text 2 file(s) checked, 2 reformatted, 0 unchanged ``` ```python # src/a.py x = os.getcwd() if x == None: print("hi", sys.argv) ``` ```js // src/b.js function add(a, b) { debugger; return a + b; } ``` The two warnings stay, because removing a `debugger` or rewriting `== None` is not a safe fix. With the files above, `sudsy fix src/` therefore writes the same result and prints the remaining warnings. ## 4. Configure Without a config file Sudsy formats with its defaults and lint reports likely bugs only, never style. In a terminal `sudsy init` asks which languages to set up, which style each should follow, and whether to migrate the configs of other tools it finds; Enter takes every default, and Esc writes nothing. Without a terminal it writes a starter file: ```sh sudsy init ``` ```yaml # sudsy.yaml extends: [] # e.g. preset:python/ruff ``` To keep the style of a tool you use today, extend its preset. For Python code formatted and linted with ruff: ```sh sudsy init --preset python/ruff ``` ```yaml # sudsy.yaml extends: - preset:python/ruff ``` A rule is set to `off`, `warn` or `error` in the short form, and can sit beside the preset: ```yaml extends: - preset:python/ruff lint: rules: no-debugger: error ``` See all [rules](https://bingsubandit.github.io/sudsy/rules.md), the [presets](https://bingsubandit.github.io/sudsy/reference/presets.md) and the [format options](https://bingsubandit.github.io/sudsy/reference/format-options.md). ## 5. Editor The VS Code extension gives diagnostics, quick fixes, fix all and formatting. Install `sudsy.sudsy` from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=sudsy.sudsy), or from [Open VSX](https://open-vsx.org/extension/sudsy/sudsy) for Cursor, Windsurf and VSCodium: ```sh code --install-extension sudsy.sudsy ``` The `.vsix` for your platform from the [GitHub releases](https://github.com/bingsubandit/sudsy/releases) is the fallback. Turn on format on save per language in `.vscode/settings.json`: ```json { "[python]": { "editor.defaultFormatter": "sudsy.sudsy" }, "[javascript]": { "editor.defaultFormatter": "sudsy.sudsy" }, "editor.formatOnSave": true, "editor.codeActionsOnSave": { "source.fixAll.sudsy": "explicit" } } ``` `sudsy lsp` is a language server over stdio, so any editor with an LSP client can use it. See [editors and CI](https://github.com/bingsubandit/sudsy/blob/main/docs/editors-and-ci.md). ## 6. CI `sudsy check` runs the format check and the linter together and exits 1 on an unformatted file or a rule error. With `--format github` the findings appear as annotations on the pull request. ```yaml # .github/workflows/sudsy.yml name: sudsy on: [push, pull_request] jobs: check: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: { node-version: 22 } - run: npx @sudsylint/sudsy check --format github ``` ## 7. Next - [Command line](https://bingsubandit.github.io/sudsy/cli.md): every command and the JSON output - [Rules](https://bingsubandit.github.io/sudsy/rules.md): search and filter every rule - [Languages](https://bingsubandit.github.io/sudsy/languages.md): what each language supports and how it compares - [Compared tools](https://bingsubandit.github.io/sudsy/compare.md): rule by rule against ESLint, ruff, hadolint and the others --- # Command line > The sudsy commands, exit codes and machine-readable output, for scripts and coding agents. ## Commands | Command | What it does | Exit | |---|---|---| | `sudsy check [paths]` | `format --check` and `lint` together, for CI; an unformatted file is an error diagnostic `format` | 1 on an error or an unformatted file | | `sudsy fix [paths]` | Apply fixes, then format (`--unsafe` also applies unsafe fixes) | 1 if errors remain | | `sudsy lint [paths]` | Report rule violations | 1 on an error | | `sudsy format [--check] [paths]` | Format files in place | 1 if `--check` finds changes | | `sudsy rules [term] [--language ]` | List rules; an exact rule id, or an id of another tool such as `SA1005`, explains the rule | 2 when nothing matches | | `sudsy config print [file]` | The resolved configuration with the source of each value | 0 | | `sudsy init [--preset ] [--from ] [--agents] [--yes]` | Ask in a terminal, then write `sudsy.yaml`; without a terminal write a starter, migrate another tool's config, or add the agent block | 0 | Exit 2 means a file could not be processed or the configuration is invalid. ## Machine-readable output `check`, `lint` and `fix` take `--format human|json|sarif|github`. With `--format json` stdout is one document: ```json { "version": 1, "summary": { "errors": 1, "warnings": 0 }, "diagnostics": [ { "path": "src/a.json", "rule": "no-duplicate-keys", "category": "correctness", "severity": "error", "message": "...", "range": { "start": { "line": 3, "column": 5, "offset": 41 }, "end": { "line": 3, "column": 8, "offset": 44 } }, "related": [], "fixes": [{ "title": "...", "kind": "safe", "edits": [{ "start": 41, "end": 44, "text": "" }] }] } ] } ``` Lines and columns are 1-based; offsets are bytes. A fix `kind` is `safe`, `suggestion` or `unsafe`; `sudsy fix` applies the safe ones. `--format sarif` writes SARIF 2.1.0 for code scanning, `--format github` writes workflow annotations. An agent's loop: run `sudsy check --format json`, read `diagnostics`, run `sudsy fix`, run the check again, and edit by hand only what is left. ## Rules as data `sudsy rules ` explains one rule in text. Every rule as JSON (id, languages, category, default level, fix kind, options, upstream equivalents and a before and after example) is [`rules.json`](https://bingsubandit.github.io/sudsy/rules.json.md) on this site, built from the same data as the [rule pages](https://bingsubandit.github.io/sudsy/rules.md). The configuration schema is `schemas/sudsy.schema.json` in the repository. ## For coding agents `sudsy init --agents` adds a short block to `AGENTS.md` (to `CLAUDE.md` when only that file exists) that tells an agent to run `sudsy check` and `sudsy fix`. It writes nothing without the flag, and running it again leaves the file as it is. This site publishes [`llms.txt`](https://bingsubandit.github.io/sudsy/llms.txt.md), [`llms-full.txt`](https://bingsubandit.github.io/sudsy/llms-full.txt.md) and a Markdown copy of every page (add `.md` to the page path). ## In CI and pre-commit The GitHub Action runs `sudsy check --format github`: ```yaml - uses: bingsubandit/sudsy@v0 with: version: latest # or a release; `local` uses the sudsy on PATH args: src # optional ``` pre-commit hooks `sudsy-check` and `sudsy-fix` (`language: system`, so `sudsy` must be on PATH): ```yaml repos: - repo: https://github.com/bingsubandit/sudsy rev: v0.1.0 hooks: - id: sudsy-check ``` --- # Languages > Every language Sudsy formats and lints, with its status against the reference tools. 26 of 29 languages are ready, 3 are in progress and 0 are not measured yet. `Ready` means the first tool of each column is at least 85%; the others are shown for reference. Each bar is a share measured on real-world code against the default rule set of the reference tool (a language measured with another set says so on its page); the tick marks 85%. Ready languages come first, then the others, each by how widely the language is used. [How each language is measured](https://bingsubandit.github.io/sudsy/measured.md). **[HTML](https://bingsubandit.github.io/sudsy/languages/html.md)**: Ready - Format: 95% of files identical to Prettier - Lint: 92% of findings also reported with html-validate - Lint: 88% of findings also reported with html-eslint - Lint: 91% of findings also reported with htmlhint **[JavaScript / TypeScript](https://bingsubandit.github.io/sudsy/languages/js.md)**: Ready - Format: 95% of files identical to Prettier - Lint: 100% of findings also reported with ESLint - Lint: 100% of findings also reported with typescript-eslint **[CSS / SCSS / Less](https://bingsubandit.github.io/sudsy/languages/css.md)**: Ready - Format: 92% of files identical to Prettier - Lint: 94% of findings also reported with stylelint - Lint: 89% of findings also reported with stylelint-scss - Lint: 85% of findings also reported with stylelint-less **[JSON / JSONC](https://bingsubandit.github.io/sudsy/languages/json.md)**: Ready - Format: 99% of files identical to Prettier - Format: 99% of files identical to Biome - Lint: 100% of findings also reported with eslint-plugin-jsonc **[Markdown](https://bingsubandit.github.io/sudsy/languages/markdown.md)**: Ready - Format: 92% of files identical to Prettier - Lint: 99% of findings also reported with markdownlint **[Python](https://bingsubandit.github.io/sudsy/languages/python.md)**: Ready - Format: 97% of files identical to ruff format - Lint: 94% of findings also reported with ruff **[YAML](https://bingsubandit.github.io/sudsy/languages/yaml.md)**: Ready - Format: 94% of files identical to Prettier - Lint: 98% of findings also reported with yamllint **[Shell](https://bingsubandit.github.io/sudsy/languages/shell.md)**: Ready - Format: 86% of files identical to shfmt - Lint: 86% of findings also reported with ShellCheck **[Dockerfile](https://bingsubandit.github.io/sudsy/languages/dockerfile.md)**: Ready - Format: no reference tool - Lint: 91% of findings also reported with hadolint **[SQL](https://bingsubandit.github.io/sudsy/languages/sql.md)**: Ready - Format: 85% of files identical to sqlfluff - Lint: 90% of findings also reported with sqlfluff **[Java](https://bingsubandit.github.io/sudsy/languages/java.md)**: Ready - Format: 91% of files identical to google-java-format - Lint: 88% of findings also reported with Checkstyle **[GitHub Actions](https://bingsubandit.github.io/sudsy/languages/github-actions.md)**: Ready - Format: no reference tool - Lint: 87% of findings also reported with actionlint **[C#](https://bingsubandit.github.io/sudsy/languages/csharp.md)**: Ready - Format: 85% of files identical to CSharpier - Lint: 87% of findings also reported with StyleCop - Lint: 0% of findings also reported with Roslynator **[PowerShell](https://bingsubandit.github.io/sudsy/languages/powershell.md)**: Ready - Format: 92% of files identical to Invoke-Formatter - Lint: 87% of findings also reported with PSScriptAnalyzer **[TOML](https://bingsubandit.github.io/sudsy/languages/toml.md)**: Ready - Format: 98% of files identical to taplo - Lint: 22 rules, no reference tool **[XML](https://bingsubandit.github.io/sudsy/languages/xml.md)**: Ready - Format: 100% of files identical to CSharpier XML - Lint: 24 rules, no reference tool **[Go](https://bingsubandit.github.io/sudsy/languages/go.md)**: Lint only: Ready - Format: no reference tool - Lint: 97% of findings also reported with revive **[CMake](https://bingsubandit.github.io/sudsy/languages/cmake.md)**: Ready - Format: 90% of files identical to gersemi - Lint: 97% of findings also reported with cmake-lint **[Kotlin](https://bingsubandit.github.io/sudsy/languages/kotlin.md)**: Ready - Format: 85% of files identical to ktlint - Lint: 92% of findings also reported with ktlint **[Vue / Svelte](https://bingsubandit.github.io/sudsy/languages/vue.md)**: Ready - Format: 91% of files identical to Prettier - Lint: 88% of findings also reported with eslint-plugin-vue - Lint: 100% of findings also reported with eslint-plugin-svelte **[Terraform (HCL)](https://bingsubandit.github.io/sudsy/languages/hcl.md)**: Ready - Format: 99% of files identical to terraform fmt - Lint: 93% of findings also reported with tflint **[Angular templates](https://bingsubandit.github.io/sudsy/languages/angular.md)**: Ready - Format: 99% of files identical to Prettier - Lint: 99% of findings also reported with angular-eslint **[INI / EditorConfig / .gitignore](https://bingsubandit.github.io/sudsy/languages/ini.md)**: Ready - Format: no reference tool - Lint: 31 rules, no reference tool **[Ruby](https://bingsubandit.github.io/sudsy/languages/ruby.md)**: Ready - Format: 86% of files identical to RuboCop - Lint: 96% of findings also reported with RuboCop **[GraphQL](https://bingsubandit.github.io/sudsy/languages/graphql.md)**: Ready - Format: 99% of files identical to Prettier - Lint: 29 rules, no reference tool **[Protobuf](https://bingsubandit.github.io/sudsy/languages/protobuf.md)**: Ready - Format: 99% of files identical to buf format - Lint: 89% of findings also reported with buf **[C / C++](https://bingsubandit.github.io/sudsy/languages/c.md)**: In progress - Format: 69% of files identical to clang-format - Lint: not measured with clang-tidy **[Makefile](https://bingsubandit.github.io/sudsy/languages/makefile.md)**: In progress - Format: no reference tool - Lint: 100% of findings also reported with checkmake **[PHP](https://bingsubandit.github.io/sudsy/languages/php.md)**: In progress - Format: 88% of files identical to PHP-CS-Fixer - Lint: 36% of findings also reported with PHPStan --- # Presets > Built-in presets for `extends: [preset:/]`. A preset is an ordinary `sudsy.yaml`; writing its options by hand gives the same result. Use one with `extends: [preset:/]`. ## cmake/cmake-lint [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=cmake/cmake-lint) ```yaml # The rules of cmake-lint's defaults that Sudsy has, at warn (the rest are in docs/ai/parity/cmake-lint.yaml). cmake: lint: rules: max-line-length: level: warn options: max: 80 allow_non_breakable_words: false no-trailing-whitespace: warn statement-indent: level: warn options: allow_unindented: true no-hard-tabs: level: warn options: indentation_only: true declared-name-pattern: level: warn options: names: - "set:0:variable" - "list GET:-1:variable" - "list LENGTH:2:variable" - "list JOIN:-1:variable" - "function:0:function" - "function:1+:argument" - "macro:0:macro" - "macro:1+:argument" - "foreach:0:argument" markers: - "PARENT_SCOPE:parent_scope" - "CACHE:cache" - "CACHE INTERNAL:internal" scopes: - ":directory" - "function:local" - "macro:parent_scope" patterns: - "directory:[A-Z][0-9A-Z_]+|_[0-9a-z_]+" - "local:[a-z][a-z0-9_]+" - "internal:_[A-Z][0-9A-Z_]+" - "cache:[A-Z][0-9A-Z_]+" - "parent_scope:[A-Z][0-9A-Z_]+|_[0-9a-z_]+|[a-z][a-z0-9_]+" - "argument:[a-z][a-z0-9_]+" - "function:[0-9a-z_]+" - "macro:[0-9A-Z_]+" ignore_pattern: "^ENV\\{" reference_start: "${" reference_end: "}" statement-blank-lines: level: warn options: max: 1 documented-command: level: warn options: commands: [function, macro] doc_kinds: [LineComment] ``` ## cpp/chromium [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=cpp/chromium) ```yaml # Chromium's C++ style as clang-format's Chromium style: Google's with one parameter per line and short inline functions. cpp: format: join_closing_angles: true empty_body_own_line: true collapse_empty_blocks: true access_modifier_outdent: 1 align_escaped_newlines: left short_functions: inline bin_pack_parameters: false break_template_declarations: "yes" indent_case_labels: true penalty_return_type: 200 pointer_alignment: left spaces_before_trailing_comments: 2 ``` ## cpp/gnu [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=cpp/gnu) ```yaml # The GNU coding standards as clang-format's GNU style: braces on their own line and indented, return type on its own line, a space before every parenthesis. cpp: format: join_closing_angles: true empty_body_own_line: true collapse_empty_blocks: true break_after_return_type: all_definitions break_before_binary_operators: all brace_wrapping: [class, struct, union, enum, function, namespace, extern, control, case, else, catch, while] split_empty_braces: [class, struct, union, function, namespace] indent_braces: true line_width: 79 space_before_parens: always braced_list_padding: true space_after_cast: true ``` ## cpp/google [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=cpp/google) ```yaml # Google's C++ style guide as clang-format's Google style: two spaces, 80 columns, pointer next to the type, indented case labels. cpp: format: join_closing_angles: true empty_body_own_line: true collapse_empty_blocks: true access_modifier_outdent: 1 align_escaped_newlines: left short_ifs: without_else short_loops: true break_template_declarations: "yes" indent_case_labels: true penalty_return_type: 200 pointer_alignment: left derive_pointer_alignment: true spaces_before_trailing_comments: 2 ``` ## cpp/microsoft [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=cpp/microsoft) ```yaml # Microsoft's C++ style as clang-format's Microsoft style: four spaces, 120 columns, braces on their own line. cpp: format: join_closing_angles: true empty_body_own_line: true collapse_empty_blocks: true short_enums: false short_functions: none brace_wrapping: [class, enum, function, namespace, extern, control, else, catch] split_empty_braces: [class, function, namespace] line_width: 120 indent_size: 4 penalty_return_type: 1000 ``` ## cpp/mozilla [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=cpp/mozilla) ```yaml # Mozilla's C++ style as clang-format's Mozilla style: return type on its own line, braces of classes and functions on their own line, comma-first initializers. cpp: format: join_closing_angles: true empty_body_own_line: true collapse_empty_blocks: true indent_pp_directives: keep short_functions: inline bin_pack_arguments: false bin_pack_parameters: false break_after_return_type: top_level brace_wrapping: [class, struct, union, enum, function, extern] split_empty_braces: [function] break_constructor_initializers: before_comma break_template_declarations: "yes" constructor_initializer_indent: 2 continuation_indent: 2 indent_case_labels: true penalty_return_type: 200 pointer_alignment: left braced_list_padding: true ``` ## cpp/webkit [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=cpp/webkit) ```yaml # WebKit's C++ style as clang-format's WebKit style: four spaces, no column limit, operators first, function braces on their own line. cpp: format: join_closing_angles: true empty_body_own_line: true collapse_empty_blocks: true access_modifier_outdent: 4 align_after_open_bracket: dont_align break_before_binary_operators: all brace_wrapping: [function] break_constructor_initializers: before_comma wrap_lines: false indent_size: 4 namespace_indentation: inner pointer_alignment: left braced_list_padding: true ``` ## csharp/csharpier-compat CSharpier 1.x layout through the named C# options, including `sort_usings: true`. [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=csharp/csharpier-compat) ```yaml # Formats like CSharpier 1.x, for migrating without reformat churn. csharp: format: line_width: 100 trailing_commas: multiline blank_lines_between_members: separate accessor_blank_lines: remove collection_blank_lines: remove inline_accessor_bodies: true indent_switch_section_block: false assignment_layout: fluid assignment_conditional: binary_test assignment_conditional_test_kinds: [ParenthesizedExpression] switch_arm_layout: assignment indent_nested_binary: true binary_group_single: true binary_group_mixed_chains: false binary_open_kinds: [OrPattern, AndPattern] member_chain_style: grouped member_chain_keep_accesses: always member_chain_factory_heads: false member_chain_hug_calls: 1 member_chain_indent_head: true member_chain_break_on_block: "inner" label_blank_line: true wrapped_brace_line: all initializer_collapse: always initializer_expand: crowded initializer_group: creation hug_last_argument: sole_bare constructor_initializer_line: new_line parameter_attribute_layout: hanging base_list_layout: hanging unbreakable_single_item_lists: true conditional_layout: ladder declarator_own_line_kinds: [VariableDeclaration] stacked_flush_kinds: [UsingStatement, FixedStatement] hanging_clause_kinds: [WhenClause, CatchFilterClause] hang_operand_kinds: [CastExpression] paren_condition_kinds: [IfStatement, WhileStatement, DoStatement, LockStatement, SwitchStatement, UsingStatement, FixedStatement] assignment_inline_test_kinds: [IsPatternExpression] member_chain_hold_comments: true do_while_line: same_line space_between_empty_for_clauses: true space_after_empty_last_for_clause: true sort_usings: true derive_symbol_sets: true ``` ## csharp/dotnet-runtime The defaults plus `inline_accessor_bodies`. [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=csharp/dotnet-runtime) ```yaml # The dotnet/runtime coding style: Microsoft's layout, except that a short accessor body stays on # the accessor's line (`get { return _count; }`). csharp: format: inline_accessor_bodies: true ``` ## csharp/google 2 spaces, 100 columns, K&R braces, `{}` for empty bodies. No alignment of the first argument: wrapped lines continue with 4 spaces. Trailing comments not aligned. Arguments go one per line when they do not fit. [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=csharp/google) ```yaml # Google's C# style guide: two spaces, 100 columns, braces on the line of the header, `} else {`, # `{}` for an empty body, trailing commas in multi-line lists. csharp: format: line_width: 100 indent_size: 2 brace_newline: none trailing_commas: multiline wrapped_brace_line: none clause_keyword_line: same_line empty_braces: tight ``` ## csharp/roslynator The lint rules that match the analyzers Roslynator turns on by default (`constant-on-right`, `doc-summary-required`, `doc-summary-text`, `no-empty-catch`, `nullable-shorthand`, `possible-null-dereference`, `unused-assignment`, `unused-private-member`, `use-lambda`) at `warn`; `unused-private-member` needs `analysis: deep`, which a preset cannot set. Checked against Roslynator by `scripts/parity.sh coverage roslynator`. [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=csharp/roslynator) ```yaml # Roslynator.Analyzers' default set: the Sudsy rules that match the analyzers Roslynator turns on by default # (RCS1020, RCS1048, RCS1075, RCS1098, RCS1138, RCS1139, RCS1179, RCS1202, RCS1212, RCS1213). # `unused-private-member` needs `analysis: deep`, which a preset cannot set. # Checked against Roslynator by `scripts/parity.sh coverage roslynator`. csharp: lint: rules: constant-on-right: warn doc-summary-required: warn doc-summary-text: warn no-empty-catch: warn nullable-shorthand: warn possible-null-dereference: warn unused-assignment: warn unused-private-member: warn use-lambda: warn ``` ## csharp/stylecop StyleCop.Analyzers 1.2.0-beta.556 default layout: `closing_paren_line: same_line`, `empty_braces: expanded`, `blank_lines_between_members: always`, `blank_lines_after_block: require`, `blank_line_before_comment: require`, `blank_line_after_comment: remove`, `space_after_delegate: false`, `space_between_empty_for_clauses: true`, `trailing_commas: multiline`; and the lint rules that match StyleCop's style rules (`comment-space`, `doc-comment-space`, `directive-keyword-space`, `no-regions`, `member-order`, `accessor-order`, `using-order` with `compare: culture`, `static_position: after` and `alias_position: after`, ...) and the 24 documentation comment rules (rules/builtin.md) at `warn`. Checked against StyleCop itself by `scripts/parity.sh stylecop`. [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=csharp/stylecop) ```yaml # StyleCop.Analyzers' default layout: the formatter output satisfies its spacing, readability and # layout rules (SA1002, SA1008, SA1111, SA1413, SA1500-SA1516), and the Sudsy rules that match # StyleCop's style rules, including the SA16xx documentation rules, are on. csharp: format: trailing_commas: multiline closing_paren_line: same_line empty_braces: expanded blank_lines_between_members: always blank_lines_after_block: require blank_line_before_comment: require blank_line_after_comment: remove space_after_delegate: false space_between_empty_for_clauses: true lint: rules: accessor-order: warn comment-space: warn constant-on-right: warn constructor-summary-standard-text: warn debug-assert-message: warn debug-fail-message: warn destructor-summary-standard-text: warn directive-keyword-space: warn doc-comment-space: warn doc-param-has-name: warn doc-param-has-text: warn doc-param-missing: warn doc-partial-required: warn doc-partial-summary-required: warn doc-partial-summary-text: warn doc-partial-typeparams: warn doc-returns-has-text: warn doc-returns-required: warn doc-summary-required: warn doc-summary-text: warn doc-text-ends-with-period: warn doc-text-not-empty: warn doc-typeparam-has-name: warn doc-typeparam-has-text: warn doc-value-text: warn field-name-no-underscore: warn file-name-matches-type: warn inheritdoc-on-inheriting-member: warn member-order: warn missing-doc-comment: warn no-comment-before-block: warn no-default-summary: warn no-default-value-type-constructor: warn no-doc-placeholder: warn no-doc-slashes-in-plain-comment: warn no-duplicate-doc-text: warn no-empty-attribute-parens: warn no-empty-comment: warn no-empty-delegate-parens: warn no-empty-statement: warn no-region-in-body: warn no-regions: warn no-returns-on-void: warn no-unneeded-base-prefix: warn nullable-shorthand: warn property-summary-matches-accessors: warn property-summary-omits-restricted-accessor: warn qualify-instance-members: warn qualify-namespace-usings: warn separate-attributes: warn separate-field-declarations: warn single-class-per-file: warn single-namespace-per-file: warn suppression-justification: warn tuple-element-names-in-signatures: warn use-lambda: warn use-literal-suffix: warn use-string-empty: warn use-tuple-syntax: warn using-order: level: warn options: compare: culture static_position: after alias_position: after using-placement: warn ``` ## csharp/unity `unused-private-member` counts Unity's message methods (`Awake`, `Update`, `OnTriggerEnter`, ...) as used in types derived from `MonoBehaviour`, `ScriptableObject`, `Editor`, `EditorWindow`, `StateMachineBehaviour` or `AssetPostprocessor`, through the rule's `reflection_base_types` and `reflection_methods` options. A member with an attribute (`[SerializeField]`) is never reported. It also sets `member_attribute_line: keep` (`[SerializeField] private int speed;` stays on one line) and a four-space indent for `.asmdef`, `.asmref` and `.inputactions`, which Unity writes that way. It leaves `Library/`, `Temp/`, `Logs/`, `obj/`, `UserSettings/` and `Build(s)/` out (`exclude`), also without a `.gitignore`. The rule needs `analysis: deep`; a base class from a package the project cannot resolve (`class Player : Manager`) is added to `reflection_base_types`. [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=csharp/unity) ```yaml # Unity: the folders Unity generates (the package cache holds thousands of `.cs` files) are left # out; its message methods are called by reflection, so a class that derives from one of the base # types uses them without any call in the project; attributes such as `[SerializeField]` stay in # front of the field; the JSON that Unity writes itself (assembly definitions, input actions) keeps # Unity's four-space indent. exclude: [Library/**, Temp/**, Logs/**, obj/**, UserSettings/**, Build/**, Builds/**] csharp: format: member_attribute_line: keep lint: rules: unused-private-member: level: warn options: reflection_base_types: [MonoBehaviour, ScriptableObject, Editor, EditorWindow, StateMachineBehaviour, AssetPostprocessor] reflection_methods: - Awake - Start - Update - FixedUpdate - LateUpdate - OnEnable - OnDisable - OnDestroy - OnValidate - Reset - OnGUI - OnApplicationFocus - OnApplicationPause - OnApplicationQuit - OnAnimatorIK - OnAnimatorMove - OnAudioFilterRead - OnBecameVisible - OnBecameInvisible - OnCollisionEnter - OnCollisionStay - OnCollisionExit - OnCollisionEnter2D - OnCollisionStay2D - OnCollisionExit2D - OnTriggerEnter - OnTriggerStay - OnTriggerExit - OnTriggerEnter2D - OnTriggerStay2D - OnTriggerExit2D - OnControllerColliderHit - OnDrawGizmos - OnDrawGizmosSelected - OnJointBreak - OnJointBreak2D - OnMouseDown - OnMouseDrag - OnMouseEnter - OnMouseExit - OnMouseOver - OnMouseUp - OnMouseUpAsButton - OnParticleCollision - OnParticleTrigger - OnParticleSystemStopped - OnParticleUpdateJobScheduled - OnPreCull - OnPreRender - OnPostRender - OnRenderImage - OnRenderObject - OnWillRenderObject - OnTransformChildrenChanged - OnTransformParentChanged - OnBeforeTransformParentChanged - OnRectTransformDimensionsChange - OnCanvasGroupChanged - OnCanvasHierarchyChanged - OnDidApplyAnimationProperties - OnInspectorGUI - OnSceneGUI - OnPreviewGUI - OnInteractivePreviewGUI - OnHeaderGUI - HasPreviewGUI - RenderStaticPreview - CreateGUI - OnFocus - OnLostFocus - OnHierarchyChange - OnProjectChange - OnSelectionChange - OnInspectorUpdate - OnStateEnter - OnStateExit - OnStateUpdate - OnStateMove - OnStateIK - OnStateMachineEnter - OnStateMachineExit - OnPreprocessAsset - OnPostprocessAsset - OnPreprocessTexture - OnPostprocessTexture - OnPreprocessModel - OnPostprocessModel - OnPreprocessAnimation - OnPostprocessAnimation - OnPreprocessAudio - OnPostprocessAudio - OnPostprocessMaterial - OnPostprocessMeshHierarchy - OnPostprocessGameObjectWithUserProperties - OnPostprocessSprites - OnPostprocessCubemap - OnAssignMaterialModel overrides: - files: ["**/*.asmdef", "**/*.asmref", "**/*.inputactions"] json: format: indent_size: 4 ``` ## css/stylelint-recommended The rules of stylelint-config-recommended that Sudsy has, at `error` (stylelint's severity), the lint rules for `.css`, `.scss` and `.less`; `declaration-block-no-duplicate-properties` with `ignore_consecutive_different_values`. The formatter has no preset options. Checked against stylelint by `scripts/parity.sh stylelint`. [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=css/stylelint-recommended) ```yaml # The rules of stylelint-config-recommended that Sudsy has, at stylelint's severity (error). css: lint: rules: at-rule-no-deprecated: error at-rule-no-unknown: level: error options: { ignore: [] } block-no-empty: error color-no-invalid-hex: error no-empty-comment: error custom-property-no-missing-var-function: error declaration-block-no-duplicate-custom-properties: error declaration-block-no-duplicate-properties: level: error options: ignore_consecutive_different_values: true declaration-block-no-shorthand-property-overrides: error font-family-no-duplicate-names: error font-family-no-missing-generic-family-keyword: error function-calc-no-unspaced-operator: error function-linear-gradient-no-nonstandard-direction: error keyframe-block-no-duplicate-selectors: error keyframe-declaration-no-important: error media-feature-name-no-unknown: error media-type-no-deprecated: error named-grid-areas-no-invalid: error no-descending-specificity: error no-duplicate-at-import-rules: error no-duplicate-selectors: error no-empty-source: error no-invalid-double-slash-comments: error no-invalid-position-at-import-rule: error no-invalid-position-declaration: error property-no-deprecated: error property-no-unknown: error selector-anb-no-unmatchable: error selector-no-deprecated: error selector-pseudo-class-no-unknown: error selector-pseudo-element-no-unknown: error selector-type-no-unknown: level: error options: ignore: ["/-/"] ``` ## css/stylelint-standard The recommended preset and the rules of stylelint-config-standard that Sudsy has (notation, naming patterns with stylelint's kebab-case regex, `number-max-precision: 4`, `length-zero-no-unit`, ...) at `error`. The empty-line, color-function and keyword-case rules of the standard set are not built yet. [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=css/stylelint-standard) ```yaml # stylelint-config-standard: stylelint-config-recommended and the rules of the standard set that # Sudsy has, with its options. extends: [preset:css/stylelint-recommended] css: lint: rules: alpha-value-notation: error at-rule-empty-line-before: error at-rule-no-vendor-prefix: error color-function-alias-notation: error color-function-notation: error color-hex-length: error at-extend-no-missing-placeholder: error at-function-pattern: level: error options: pattern: "^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$" at-if-no-null: error at-mixin-argumentless-call-parentheses: error at-mixin-pattern: level: error options: pattern: "^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$" at-rule-conditional-no-parentheses: error dollar-variable-pattern: level: error options: pattern: "^(-?[a-z][a-z0-9]*)(-[a-z0-9]+)*$" load-no-partial-leading-underscore: error no-global-function-names: error custom-property-empty-line-before: error dollar-variable-empty-line-before: error comment-empty-line-before: error double-slash-comment-empty-line-before: error no-empty-comment: level: error options: separators: true comment-space: level: error options: block: true line: false container-name-pattern: level: error options: pattern: "^([a-z][a-z0-9]*)(-[a-z0-9]+)*$" custom-media-pattern: level: error options: pattern: "^([a-z][a-z0-9]*)(-[a-z0-9]+)*$" custom-property-pattern: level: error options: pattern: "^([a-z][a-z0-9]*)(-[a-z0-9]+)*$" declaration-block-single-line-max-declarations: level: error options: max: 1 declaration-empty-line-before: error font-family-name-quotes: error function-name-case: error function-url-quotes: error hue-degree-notation: error import-notation: level: error options: url: true keyframe-selector-notation: error keyframes-name-pattern: level: error options: pattern: "^([a-z][a-z0-9]*)(-[a-z0-9]+)*$" layer-name-pattern: level: error options: pattern: "^([a-z][a-z0-9]*)(-[a-z0-9]+)*$" length-zero-no-unit: error media-feature-name-no-vendor-prefix: error number-max-precision: level: error options: max: 4 property-no-vendor-prefix: error rule-empty-line-before: error selector-attribute-quotes: error selector-class-pattern: level: error options: pattern: "^([a-z][a-z0-9]*)(-[a-z0-9]+)*$" selector-id-pattern: level: error options: pattern: "^([a-z][a-z0-9]*)(-[a-z0-9]+)*$" selector-no-vendor-prefix: error selector-pseudo-element-colon-notation: error selector-type-case: error shorthand-property-no-redundant-values: error value-no-vendor-prefix: error ``` ## dockerfile/hadolint [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=dockerfile/hadolint) ```yaml # hadolint's rules that Sudsy has, at hadolint's severities (error is error; warning, info and style are warn). dockerfile: lint: rules: workdir-absolute: error no-interactive-commands: warn last-user-not-root: warn use-workdir-not-cd: warn no-sudo: error untagged-base-image: warn no-latest-tag: warn apt-get-pin-versions: warn expose-port-range: error single-healthcheck: error pip-pin-versions: warn apt-get-yes: warn delete-apt-lists: warn merge-consecutive-run: warn pipefail-shell: warn apt-get-no-recommends: warn npm-pin-versions: warn apk-pin-versions: warn apk-no-cache: warn copy-instead-of-add: error copy-many-needs-directory: error copy-from-unknown-stage: warn copy-from-own-stage: error duplicate-stage-name: error json-cmd-entrypoint: warn no-apt: warn gem-pin-versions: warn no-from-platform: warn yum-yes: warn yum-clean: warn rpm-pin-versions: warn zypper-yes: warn zypper-no-dist-upgrade: warn zypper-clean: warn zypper-pin-versions: warn dnf-yes: warn dnf-clean: warn no-nested-onbuild: error wget-progress: warn from-first: error go-pin-versions: warn no-reserved-stage-name: warn no-secret-in-env: warn no-redundant-target-platform: warn numeric-user-id: warn no-copy-whole-stage: warn no-maintainer: error single-cmd: warn single-entrypoint: error no-shell-symlink: warn ``` ## github-actions/actionlint [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=github-actions/actionlint) ```yaml # actionlint's checks that Sudsy has, at warn. github-actions: lint: rules: cyclic-needs: warn deprecated-commands: warn duplicate-ids: warn expression-context: warn expression-types: warn if-condition: warn invalid-expression: warn invalid-event: warn invalid-glob: warn invalid-job-id: warn invalid-permissions: warn outdated-action: warn invalid-runs-on: warn no-merge-keys: warn no-recursive-alias: warn no-undefined-alias: warn no-unused-anchors: warn script-injection: warn unknown-needs: warn workflow-syntax: warn ``` ## go/revive [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=go/revive) ```yaml # The rules of revive's default set that Sudsy has, at warn (the rest are in docs/ai/parity/revive.yaml). go: lint: rules: no-wildcard-imports: warn doc-first-word: warn error-naming: warn error-strings: warn errorf: warn increment-decrement: warn indent-error-flow: warn missing-doc-comment: warn missing-package-comment: warn no-empty-block: level: warn options: comment_handles: false waiting_loops: true ignored_loop_heads: "^range\\b" package-comment-form: warn range: warn receiver-name-consistent: warn receiver-naming: warn redefines-builtin-id: warn superfluous-else: warn unreachable-code: warn unused-parameter: warn var-naming: warn # revive checks the doc comments of non-test files only. overrides: - files: ["**/*_test.go"] go: lint: rules: doc-first-word: "off" missing-doc-comment: "off" package-comment-form: "off" # revive leaves the names of tests, examples and benchmarks alone in a test file. - files: ["**/*_test.go"] go: lint: rules: var-naming: level: warn options: ignore_pattern: "^(LastInsertId|kWh|(Example|Test|Benchmark|Fuzz).*)$" ``` ## graphql/graphql-eslint-recommended The lint rules of graphql-eslint `flat/schema-recommended` and `flat/operations-recommended` that Sudsy has and that need no schema: `naming-convention` (operations and fragments PascalCase, variables camelCase), `no-anonymous-operations`, `no-duplicate-keys`, `no-typename-prefix`, at `error`. Checked against graphql-eslint by `scripts/parity.sh coverage graphql-eslint`. [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=graphql/graphql-eslint-recommended) ```yaml # The rules of graphql-eslint's `flat/schema-recommended` and `flat/operations-recommended` that Sudsy has and that need # no schema or document set, at ESLint's severity (error), with the options the recommended configs set: operation and # fragment names in PascalCase, variables in camelCase; the other names are not checked. graphql: lint: rules: naming-convention: level: error options: operations: PascalCase fragments: PascalCase variables: camelCase fields: "off" arguments: "off" types: "off" enum_values: "off" directives: "off" no-anonymous-operations: error no-duplicate-keys: error no-name-underscore: error no-typename-prefix: error ``` ## hcl/tflint-recommended The rules of tflint-ruleset-terraform's recommended preset that Sudsy has, at `warn` (the formatter has no style options). [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=hcl/tflint-recommended) ```yaml # The rules of tflint-ruleset-terraform's recommended preset that Sudsy has (the rest are in docs/ai/parity/tflint.yaml). hcl: lint: rules: deprecated-index: warn deprecated-interpolation: warn empty-list-equality: warn no-duplicate-keys: warn required-providers: warn required-version: warn typed-variables: warn unused-declarations: warn ``` ## html/angular-eslint-recommended [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=html/angular-eslint-recommended) ```yaml # angular-eslint's template `recommended` and `accessibility` sets (@angular-eslint/template) that Sudsy has, at warn. angular: lint: rules: banana-in-box: warn eqeqeq: warn no-negated-async: warn img-alt: level: warn options: other_elements: true skip_hidden: false name_counts: true click-events-have-key-events: warn interactive-supports-focus: warn mouse-events-have-key-events: warn label-has-control: warn empty-content: warn no-autofocus: warn prefer-control-flow: warn table-scope: warn ``` ## html/eslint-plugin-svelte-recommended [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=html/eslint-plugin-svelte-recommended) ```yaml # eslint-plugin-svelte's flat/recommended rules that Sudsy has, at warn. svelte: lint: rules: no-at-debug-tags: warn no-at-html-tags: warn no-dupe-on-directives: warn no-dupe-style-properties: warn no-dupe-use-directives: warn no-object-in-text-mustaches: warn no-raw-special-elements: warn no-unknown-style-directive-property: warn no-useless-children-snippet: warn no-useless-mustaches: warn require-each-key: warn ``` ## html/eslint-plugin-vue-recommended [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=html/eslint-plugin-vue-recommended) ```yaml # eslint-plugin-vue's flat/recommended rules that Sudsy has, at warn, and the layout of its `max-attributes-per-line`, `html-indent` (`indent_expression_operands`) and `singleline-html-element-content-newline` (`content_newline_with_attributes`). # `whitespace_sensitivity: ignore` lays out inline elements as blocks, which can change the spaces a browser renders; the default stays `css`. vue: format: single_attribute_per_line: true whitespace_sensitivity: ignore content_newline_with_attributes: true indent_expression_operands: true lint: rules: attr-delimiter: warn attr-quotes: warn attribute-hyphenation: warn attributes-order: warn html-self-closing: warn no-child-content: warn no-deprecated-functional-template: warn no-deprecated-html-element-is: warn no-deprecated-inline-template: warn no-deprecated-scope-attribute: warn no-deprecated-slot-attribute: warn no-deprecated-slot-scope-attribute: warn no-deprecated-v-bind-sync: warn no-deprecated-v-is: warn no-deprecated-v-on-native-modifier: warn no-deprecated-v-on-number-modifiers: warn no-dupe-keys: warn no-dupe-v-else-if: warn no-duplicate-keys: warn no-lone-template: warn no-textarea-mustache: warn no-use-v-if-with-v-for: warn no-v-for-template-key-on-child: warn no-v-html: warn no-v-text-v-html-on-component: warn require-component-is: warn require-default-prop: warn require-prop-types: warn v-bind-style: warn v-for-key: warn v-on-event-hyphenation: warn v-on-style: warn v-slot-style: warn valid-v-bind: warn valid-v-cloak: warn valid-v-else: warn valid-v-else-if: warn valid-v-for: warn valid-v-html: warn valid-v-if: warn valid-v-is: warn valid-v-memo: warn valid-v-model: warn valid-v-on: warn valid-v-once: warn valid-v-pre: warn valid-v-show: warn valid-v-slot: warn valid-v-text: warn ``` ## html/html-eslint-recommended [Rules it enables](https://bingsubandit.github.io/sudsy/rules/?preset=html/html-eslint-recommended) ```yaml # @html-eslint's recommended rules that Sudsy has, at warn, and the layout of its `indent`, `attrs-newline` (more than 2 attributes, each on a line) and `no-extra-spacing-tags` and `require-closing-tags` (`
`, ``). # `dialect: template` keeps `{{ }}` actions (Hugo, Go templates) as written; text without them formats as before. # `whitespace_sensitivity: ignore` lays out inline elements as blocks (`element-newline`, no `>Home # Format options > Every formatting option per language, with its type, default and allowed values. Set under `.format` in `sudsy.yaml`. The options `indent_style`, `indent_size`, `line_width`, `end_of_line`, `final_newline`, `bracket_spacing` and `array_bracket_spacing` can also be set once under a top-level `format`. ## angular | Option | Type | Default | Description | |---|---|---|---| | `bracket_same_line` | boolean | `false` | Put the `>` of a multi-line start tag at the end of the last attribute's line. | | `content_newline_with_attributes` | boolean | `false` | Put the content of an element that has attributes on lines of its own, also when the element fits on a line; inline elements and `pre` keep theirs (`vue/singleline-html-element-content-newline` with its defaults). | | `content_newline_with_elements` | boolean | `false` | Put the children of an element that has an element child on lines of their own, also when they fit on a line; only where the whitespace between them is not significant (`whitespace_sensitivity: ignore`, `@html-eslint/element-newline`). | | `embedded_language_formatting` | string | `"auto"` | Format the code of `