@sudsylint/sudsy 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +29 -73
  2. package/package.json +30 -8
package/README.md CHANGED
@@ -1,94 +1,50 @@
1
- <p align="center"><img src="assets/logo/soap_3d.png" alt="Sudsy" width="96"></p>
2
-
3
1
  # Sudsy
4
2
 
5
- A formatter and linter for <!-- generated:languages -->C#, C/C++, CSS, Dockerfile, EditorConfig, Gitignore, GraphQL, HCL, HTML, INI, JSON, Java, JavaScript/TypeScript, Kotlin, Makefile, Markdown, PHP, PowerShell, Protobuf, Python, Ruby, SQL, Shell, TOML, XML and YAML<!-- /generated --> (JSON includes JSONC; XML covers `.csproj`, `.props`, `.targets`, `.config`, ...), configured from one `sudsy.yaml`.
6
-
7
- - **Formatting**: every layout decision is a named option; presets reproduce the styles of Microsoft, the .NET runtime, Google, CSharpier and Prettier. Debug builds, the tests and the `corpus` profile check that each result has the same syntax tree (and for YAML the same data) as the input; release builds trust the formatter and do not run that check.
8
- - **Linting**: built-in rules for every language, semantic C# rules (types, control and data flow), safe and unsafe fixes, suppression comments, [pattern rules](docs/rules/patterns.md) in YAML and [Wasm plugins](docs/rules/plugins.md) (unstable API).
9
- - **Implementation**: a Rust core. JSON and YAML are parsed natively and TOML, XML and Markdown by embedded tree-sitter grammars; C# is parsed and analysed by a Roslyn-backed .NET worker that the CLI starts when it needs it.
3
+ **One formatter and linter for your whole repo.** One binary and one config file in place of Prettier, ESLint, ruff, buf, terraform fmt and the rest, measured file by file against each of them.
10
4
 
11
- Measured speed against CSharpier, Prettier, Biome and dprint, with the method and machine: [docs/performance/numbers.md](docs/performance/numbers.md).
5
+ <!-- generated:support-headline -->Ready for 9 languages, early support for 18 more.<!-- /generated --> <!-- generated:support-ready -->Ready: JavaScript / TypeScript, Python, Protobuf, GraphQL, TOML, Angular templates, XML, Ruby and Makefile. The rest are in progress.<!-- /generated --> Early release (v0.0.x): config may change before 1.0.
6
+ <!-- generated:support-headline -->Ready for 8 languages, early support for 19 more.<!-- /generated --> <!-- generated:support-ready -->Ready: Python, Protobuf, GraphQL, TOML, Angular templates, XML, Ruby and Makefile. The rest are in progress.<!-- /generated --> Early release (v0.0.x): config may change before 1.0.
12
7
 
13
- ## Install
8
+ ## Try it
14
9
 
15
- - **CLI**: download the archive for your platform (Linux, Windows or macOS; x64 or arm64) from the GitHub releases page and put the `sudsy` executable on your `PATH`. Keep the `csharp-worker/` directory beside it.
16
- - **Package managers** (same binary, `csharp-worker/` included except with cargo-binstall): `npm i -D @sudsylint/sudsy`, `pip install sudsy` / `uvx sudsy`, `brew install bingsubandit/sudsy/sudsy`, `scoop bucket add sudsy https://github.com/bingsubandit/scoop-sudsy && scoop install sudsy`, `winget install Coox.Sudsy`, `cargo binstall --git https://github.com/bingsubandit/sudsy sudsy`. Setup and publishing: [docs/development/ci-release.md](docs/development/ci-release.md).
17
- - **VS Code**: install the extension `Coox.sudsy`. It bundles the CLI and the worker.
18
- - **C#** needs the [.NET 10 runtime](https://dotnet.microsoft.com/download/dotnet/10.0). Every other language works without it.
19
-
20
- ## Quick start
10
+ Read-only: `check` reports and changes no files. No config needed.
21
11
 
22
12
  ```sh
23
- sudsy init --preset csharp/google # writes a starter sudsy.yaml
24
- sudsy format # format the current directory in place
25
- sudsy lint # report rule violations
26
- sudsy fix # apply fixes, then format
27
- sudsy rules # list the rules; `sudsy rules <id>` explains one
13
+ npx @sudsylint/sudsy check src/ # or: uvx sudsy check src/
28
14
  ```
29
15
 
30
- In CI, `sudsy check` runs `format --check` and `lint` together and exits 1 when a file is unformatted or a rule reports an error:
31
-
32
- ```sh
33
- sudsy check --format github # ::error file=...:: annotations in the GitHub Actions log
34
- sudsy check --format sarif > sudsy.sarif # for code scanning upload
16
+ ```
17
+ a.py:1:1: error[format]: the file is not formatted; run `sudsy format`
18
+ a.py:1:8: warning[unused-import]: `os` imported but unused
19
+ b.js:3:18: warning[no-debugger]: Unexpected 'debugger' statement.
35
20
  ```
36
21
 
37
- Output formats are `human`, `json`, `sarif` and `github`. Exit codes and all commands: [docs/config/cli.md](docs/config/cli.md).
38
-
39
- ## Presets
22
+ With no config, lint reports likely bugs only, never style. `sudsy format` rewrites the files; `sudsy fix` applies safe fixes, then formats. Some languages are small downloads: `sudsy languages add toml protobuf`.
40
23
 
41
- Presets are ordinary config files; writing their options by hand in `sudsy.yaml` gives the same output.
24
+ ## Install
42
25
 
43
- | Preset | Style |
26
+ | Channel | Command |
44
27
  |---|---|
45
- | `csharp/dotnet-runtime` | The defaults plus inline accessor bodies |
46
- | `csharp/google` | 2 spaces, 100 columns, K&R braces |
47
- | `csharp/csharpier-compat` | CSharpier 1.x layout |
48
- | `csharp/stylecop` | StyleCop.Analyzers layout (blank lines, `)` placement, empty bodies) and its matching rules |
49
- | `json/prettier-compat`, `yaml/prettier-compat` | Prettier-like (width 80) |
50
- | `toml/taplo-compat` | taplo's defaults |
51
- | `xml/csharpier-compat` | CSharpier 1.x's XML defaults |
28
+ | npm | `npm i -D @sudsylint/sudsy` |
29
+ | PyPI | `pip install sudsy` or `uvx sudsy` |
30
+ | Homebrew | `brew install bingsubandit/sudsy/sudsy` |
31
+ | Scoop | `scoop bucket add sudsy https://github.com/bingsubandit/scoop-sudsy; scoop install sudsy` |
32
+ | Binary | [GitHub releases](https://github.com/bingsubandit/sudsy/releases): Linux, macOS, Windows; x64 and arm64 |
52
33
 
53
- Without `extends` every language uses Sudsy's defaults (C#: Microsoft's layout) and existing `.editorconfig` keys apply; presets exist only where they set something. Details: [docs/formatting/presets.md](docs/formatting/presets.md).
34
+ Only C# needs more: the [.NET 10 runtime](https://dotnet.microsoft.com/download/dotnet/10.0).
54
35
 
55
- ## Configuration
36
+ ## Configure
56
37
 
57
- ```yaml
58
- extends: [preset:csharp/google, preset:json/prettier-compat]
59
- exclude: ["**/Generated/**"]
60
- analysis: standard # fast | standard | deep
61
- csharp:
62
- format: { line_width: 120 }
63
- lint:
64
- rules:
65
- no-empty-catch: error
66
- overrides:
67
- - files: ["tests/**"]
68
- csharp: { lint: { rules: { async-suffix: "off" } } }
69
- ```
70
-
71
- `sudsy config print` shows the resolved config and where each value came from. A JSON Schema is in [schemas/sudsy.schema.json](schemas/sudsy.schema.json). Reference: [docs/config/sudsy-yaml.md](docs/config/sudsy-yaml.md), [.editorconfig mapping](docs/config/editorconfig.md).
72
-
73
- ## Editor setup
74
-
75
- The VS Code extension runs `sudsy lsp` and gives diagnostics, quick fixes, fix all and formatting. Format on save is your choice, per language:
76
-
77
- ```json
78
- {
79
- "[csharp]": { "editor.defaultFormatter": "Coox.sudsy", "editor.formatOnSave": true },
80
- "[json]": { "editor.defaultFormatter": "Coox.sudsy", "editor.formatOnSave": true },
81
- "[yaml]": { "editor.defaultFormatter": "Coox.sudsy", "editor.formatOnSave": true },
82
- "editor.codeActionsOnSave": { "source.fixAll.sudsy": "explicit" }
83
- }
38
+ ```sh
39
+ sudsy init --preset python/ruff # a starter sudsy.yaml
40
+ sudsy init --from prettier # read your .prettierrc and write the matching options
84
41
  ```
85
42
 
86
- Any editor with an LSP client can start `sudsy lsp` (stdio). See [docs/editor/vscode.md](docs/editor/vscode.md) and [docs/editor/lsp.md](docs/editor/lsp.md).
87
-
88
- ## Documentation
89
-
90
- [docs/README.md](docs/README.md) indexes everything: architecture, per-language formatting options, the rule engine and built-in rules, pattern rules, plugins, performance, CI and release. The rule reference is also built as a searchable site ([docs/development/site.md](docs/development/site.md)). Planned and deliberately skipped work: [docs/roadmap.md](docs/roadmap.md). Changes: [CHANGELOG.md](CHANGELOG.md).
43
+ ## Learn more
91
44
 
92
- ## License and contributing
45
+ - [How close each language is to its reference tool](https://github.com/bingsubandit/sudsy#languages) (Prettier, ruff, buf, terraform fmt, ...)
46
+ - [Performance against Prettier, Biome, ruff, oxlint, CSharpier](https://github.com/bingsubandit/sudsy#performance)
47
+ - [Configuration](https://github.com/bingsubandit/sudsy/blob/main/docs/configuration.md), [rules and plugins](https://github.com/bingsubandit/sudsy/blob/main/docs/rules.md), [editors and CI](https://github.com/bingsubandit/sudsy/blob/main/docs/editors-and-ci.md)
48
+ - [Source, issues and changelog](https://github.com/bingsubandit/sudsy)
93
49
 
94
- MIT, copyright Maia Coox ([LICENSE](LICENSE)); test and benchmark inputs from other projects are listed in [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md). Contributions need a DCO sign-off; see [CONTRIBUTING.md](CONTRIBUTING.md).
50
+ MIT licensed.
package/package.json CHANGED
@@ -1,8 +1,30 @@
1
1
  {
2
2
  "name": "@sudsylint/sudsy",
3
- "version": "0.0.2",
4
- "description": "Formatter and linter for C#, JSON, YAML and more",
3
+ "version": "0.0.3",
4
+ "description": "Formatter and linter for 27 languages in one binary and one config file",
5
5
  "license": "MIT",
6
+ "keywords": [
7
+ "formatter",
8
+ "linter",
9
+ "code-quality",
10
+ "prettier",
11
+ "eslint",
12
+ "ruff",
13
+ "biome",
14
+ "stylelint",
15
+ "shellcheck",
16
+ "hadolint",
17
+ "markdownlint",
18
+ "rubocop",
19
+ "yamllint",
20
+ "shfmt",
21
+ "ktlint",
22
+ "phpstan",
23
+ "csharpier",
24
+ "stylecop",
25
+ "tflint",
26
+ "javascript"
27
+ ],
6
28
  "repository": {
7
29
  "type": "git",
8
30
  "url": "git+https://github.com/bingsubandit/sudsy.git"
@@ -17,11 +39,11 @@
17
39
  "README.md"
18
40
  ],
19
41
  "optionalDependencies": {
20
- "@sudsylint/cli-linux-x64": "0.0.2",
21
- "@sudsylint/cli-linux-arm64": "0.0.2",
22
- "@sudsylint/cli-darwin-x64": "0.0.2",
23
- "@sudsylint/cli-darwin-arm64": "0.0.2",
24
- "@sudsylint/cli-win32-x64": "0.0.2",
25
- "@sudsylint/cli-win32-arm64": "0.0.2"
42
+ "@sudsylint/cli-linux-x64": "0.0.3",
43
+ "@sudsylint/cli-linux-arm64": "0.0.3",
44
+ "@sudsylint/cli-darwin-x64": "0.0.3",
45
+ "@sudsylint/cli-darwin-arm64": "0.0.3",
46
+ "@sudsylint/cli-win32-x64": "0.0.3",
47
+ "@sudsylint/cli-win32-arm64": "0.0.3"
26
48
  }
27
49
  }