@sudsylint/sudsy 0.0.2 → 0.0.4

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 +27 -74
  2. package/package.json +30 -8
package/README.md CHANGED
@@ -1,94 +1,47 @@
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
+ **A true polyglot formatter and linter for every repo.** One binary and one config file in place of Prettier, ESLint, ruff, buf, terraform fmt and the rest. Extensible: add your own rules as YAML patterns or Wasm plugins.
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 32 languages, early support for 4 more.<!-- /generated --> <!-- generated:support-ready -->Ready: HTML, JavaScript / TypeScript, CSS / SCSS / Less, JSON / JSONC, Markdown, Python, YAML, Shell, Dockerfile, SQL, Jupyter Notebook, Java, Batchfile, GitHub Actions, C#, PowerShell, Makefile, Kubernetes manifests, TOML, XML, Go, CMake, Kotlin, Vue / Svelte, Terraform (HCL), Angular templates, INI / EditorConfig / .gitignore, Ansible, Ruby, Procfile, GraphQL and Protobuf. The rest are in progress.<!-- /generated --> Early release (v0.0.x): config may change before 1.0.
12
6
 
13
- ## Install
7
+ ## Try it
14
8
 
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
9
+ Read-only: `check` reports and changes no files. No config needed.
21
10
 
22
11
  ```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
12
+ npx @sudsylint/sudsy check src/ # or: uvx sudsy check src/
28
13
  ```
29
14
 
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
15
+ ```
16
+ a.py:1:1: error[format]: the file is not formatted; run `sudsy format`
17
+ a.py:1:8: warning[unused-import]: `os` imported but unused
18
+ b.js:3:18: warning[no-debugger]: Unexpected 'debugger' statement.
35
19
  ```
36
20
 
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
21
+ With no config, lint reports likely bugs only, never style. `sudsy format` rewrites the files; `sudsy fix` applies safe fixes, then formats.
40
22
 
41
- Presets are ordinary config files; writing their options by hand in `sudsy.yaml` gives the same output.
23
+ ## Install
42
24
 
43
- | Preset | Style |
25
+ | Channel | Command |
44
26
  |---|---|
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 |
27
+ | npm | `npm i -D @sudsylint/sudsy` |
28
+ | PyPI | `pip install sudsy` or `uvx sudsy` |
29
+ | Homebrew | `brew install bingsubandit/sudsy/sudsy` |
30
+ | Scoop | `scoop bucket add sudsy https://github.com/bingsubandit/scoop-sudsy; scoop install sudsy` |
31
+ | Binary | [GitHub releases](https://github.com/bingsubandit/sudsy/releases): Linux, macOS, Windows; x64 and arm64 |
52
32
 
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).
33
+ ## Configure
54
34
 
55
- ## Configuration
56
-
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
- }
35
+ ```sh
36
+ sudsy init --preset python/ruff # a starter sudsy.yaml
37
+ sudsy init --from prettier # read your .prettierrc and write the matching options
84
38
  ```
85
39
 
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).
40
+ ## Learn more
91
41
 
92
- ## License and contributing
42
+ - [How close each language is to its reference tool](https://github.com/bingsubandit/sudsy#languages) (Prettier, ruff, buf, terraform fmt, ...)
43
+ - [Performance against Prettier, Biome, ruff, oxlint, CSharpier](https://github.com/bingsubandit/sudsy#performance)
44
+ - [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)
45
+ - [Source, issues and changelog](https://github.com/bingsubandit/sudsy)
93
46
 
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).
47
+ 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.4",
4
+ "description": "A true polyglot formatter and linter for 36 languages: one binary and one config file in place of Prettier, ESLint, ruff and more",
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
+ "html"
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.4",
43
+ "@sudsylint/cli-linux-arm64": "0.0.4",
44
+ "@sudsylint/cli-darwin-x64": "0.0.4",
45
+ "@sudsylint/cli-darwin-arm64": "0.0.4",
46
+ "@sudsylint/cli-win32-x64": "0.0.4",
47
+ "@sudsylint/cli-win32-arm64": "0.0.4"
26
48
  }
27
49
  }