@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.
- package/README.md +27 -74
- 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
|
|
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
|
-
|
|
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
|
-
##
|
|
7
|
+
## Try it
|
|
14
8
|
|
|
15
|
-
-
|
|
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
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
|
|
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
|
-
|
|
23
|
+
## Install
|
|
42
24
|
|
|
43
|
-
|
|
|
25
|
+
| Channel | Command |
|
|
44
26
|
|---|---|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
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
|
-
|
|
33
|
+
## Configure
|
|
54
34
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
47
|
+
MIT licensed.
|
package/package.json
CHANGED
|
@@ -1,8 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudsylint/sudsy",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
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.
|
|
21
|
-
"@sudsylint/cli-linux-arm64": "0.0.
|
|
22
|
-
"@sudsylint/cli-darwin-x64": "0.0.
|
|
23
|
-
"@sudsylint/cli-darwin-arm64": "0.0.
|
|
24
|
-
"@sudsylint/cli-win32-x64": "0.0.
|
|
25
|
-
"@sudsylint/cli-win32-arm64": "0.0.
|
|
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
|
}
|