@jakebailey/dprint-plugin-gofumpt 0.0.1 → 0.0.13

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Jake Bailey
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,45 +1,71 @@
1
- # @jakebailey/dprint-plugin-gofumpt
2
-
3
- ## ⚠️ IMPORTANT NOTICE ⚠️
4
-
5
- **This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
6
-
7
- This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
8
-
9
- ## Purpose
10
-
11
- This package exists to:
12
- 1. Configure OIDC trusted publishing for the package name `@jakebailey/dprint-plugin-gofumpt`
13
- 2. Enable secure, token-less publishing from CI/CD workflows
14
- 3. Establish provenance for packages published under this name
15
-
16
- ## What is OIDC Trusted Publishing?
17
-
18
- OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
19
-
20
- ## Setup Instructions
21
-
22
- To properly configure OIDC trusted publishing for this package:
23
-
24
- 1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
25
- 2. Configure the trusted publisher (e.g., GitHub Actions)
26
- 3. Specify the repository and workflow that should be allowed to publish
27
- 4. Use the configured workflow to publish your actual package
28
-
29
- ## DO NOT USE THIS PACKAGE
30
-
31
- This package is a placeholder for OIDC configuration only. It:
32
- - Contains no executable code
33
- - Provides no functionality
34
- - Should not be installed as a dependency
35
- - Exists only for administrative purposes
36
-
37
- ## More Information
38
-
39
- For more details about npm's trusted publishing feature, see:
40
- - [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
41
- - [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
42
-
43
- ---
44
-
45
- **Maintained for OIDC setup purposes only**
1
+ # dprint-plugin-gofumpt
2
+
3
+ A [dprint](https://dprint.dev/) plugin for formatting Go code using
4
+ [gofumpt](https://github.com/mvdan/gofumpt).
5
+
6
+ ## Getting Started
7
+
8
+ Run the command below to add the plugin:
9
+
10
+ ```sh
11
+ dprint config add jakebailey/gofumpt
12
+ ```
13
+
14
+ After adding the plugin, configure the plugin in `dprint.json`:
15
+
16
+ ```jsonc
17
+ {
18
+ // ...
19
+ "gofumpt": {
20
+ // Copy these from your go.mod file!
21
+ "langVersion": "go1.24",
22
+ "modulePath": "github.com/myorg/myproject"
23
+ },
24
+ "plugins": [
25
+ "https://plugins.dprint.dev/jakebailey/gofumpt-v0.0.13.wasm"
26
+ ]
27
+ }
28
+ ```
29
+
30
+ Alternatively, the plugin is published to npm and can be referenced with an
31
+ [`npm:` specifier](https://dsherret.dev/posts/dprint-0.55/) (requires dprint
32
+ 0.55 or newer):
33
+
34
+ ```sh
35
+ dprint add npm:@jakebailey/dprint-plugin-gofumpt
36
+ ```
37
+
38
+ ```jsonc
39
+ {
40
+ // ...
41
+ "plugins": [
42
+ "npm:@jakebailey/dprint-plugin-gofumpt@0.0.13"
43
+ ]
44
+ }
45
+ ```
46
+
47
+ ## Configuration
48
+
49
+ It is recommended to set both `langVersion` and `modulePath` for consistent
50
+ formatting results, as the plugin cannot infer this information from `go.mod`.
51
+
52
+ | Property | Type | Default | Description |
53
+ | --------------------- | --------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
54
+ | `langVersion` | `string` | `""` | The Go language version to target (e.g., `"go1.24"`). Must be a valid [Go version string](https://pkg.go.dev/go/version#IsValid). If empty, defaults to `go1`. |
55
+ | `modulePath` | `string` | `""` | The module path of the package being formatted. Used for import sorting. |
56
+ | `extra` | `object` | `{}` | Enable individual extra rules. |
57
+ | `extra.groupParams` | `boolean` | `false` | Group adjacent function parameters with repeated types. |
58
+ | `extra.clotheReturns` | `boolean` | `false` | Replace naked returns in functions with named results with explicit return values. |
59
+ | `extraRules` | `boolean` | `false` | Enable all extra formatting rules beyond the default gofumpt rules. Deprecated: use `extra` to enable individual rules instead. |
60
+
61
+ ## Versions
62
+
63
+ This plugin is versioned separately from `gofumpt`. Below is a table of which
64
+ plugin versions correspond to which `gofumpt` versions.
65
+
66
+ | Plugin Version | gofumpt Version |
67
+ | -------------- | ------------------------------------- |
68
+ | v0.0.12 | v0.10.1-0.20260531213040-cc84354298ea |
69
+ | v0.0.10+ | v0.10.0 |
70
+ | v0.0.2+ | v0.9.3-0.20251215221355-d3e4b13ef7fa |
71
+ | v0.0.1 | v0.9.2 |
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ /** Gets an absolute path to the Wasm module. */
2
+ export function getPath(): string;
package/index.js ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Gets the path to the Wasm module.
3
+ * @returns {string}
4
+ */
5
+ function getPath() {
6
+ return require("path").join(__dirname, "plugin.wasm");
7
+ }
8
+
9
+ module.exports = {
10
+ getPath,
11
+ };
@@ -0,0 +1,92 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Jake Bailey
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ================================================================================
24
+ THIRD PARTY LICENSES
25
+ ================================================================================
26
+
27
+ ================================================================================
28
+ golang.org/x/tools/go/ast/astutil v0.44.0
29
+ BSD-3-Clause
30
+ ================================================================================
31
+
32
+ Copyright 2009 The Go Authors.
33
+
34
+ Redistribution and use in source and binary forms, with or without
35
+ modification, are permitted provided that the following conditions are
36
+ met:
37
+
38
+ * Redistributions of source code must retain the above copyright
39
+ notice, this list of conditions and the following disclaimer.
40
+ * Redistributions in binary form must reproduce the above
41
+ copyright notice, this list of conditions and the following disclaimer
42
+ in the documentation and/or other materials provided with the
43
+ distribution.
44
+ * Neither the name of Google LLC nor the names of its
45
+ contributors may be used to endorse or promote products derived from
46
+ this software without specific prior written permission.
47
+
48
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
49
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
50
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
51
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
52
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
53
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
54
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
55
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
56
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
57
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
58
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
59
+
60
+
61
+ ================================================================================
62
+ mvdan.cc/gofumpt v0.10.1-0.20260531213040-cc84354298ea
63
+ BSD-3-Clause
64
+ ================================================================================
65
+
66
+ Copyright (c) 2019, Daniel Martí. All rights reserved.
67
+
68
+ Redistribution and use in source and binary forms, with or without
69
+ modification, are permitted provided that the following conditions are
70
+ met:
71
+
72
+ * Redistributions of source code must retain the above copyright
73
+ notice, this list of conditions and the following disclaimer.
74
+ * Redistributions in binary form must reproduce the above
75
+ copyright notice, this list of conditions and the following disclaimer
76
+ in the documentation and/or other materials provided with the
77
+ distribution.
78
+ * Neither the name of the copyright holder nor the names of its
79
+ contributors may be used to endorse or promote products derived from
80
+ this software without specific prior written permission.
81
+
82
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
83
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
84
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
85
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
86
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
87
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
88
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
89
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
90
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
91
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
92
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package/package.json CHANGED
@@ -1,10 +1,47 @@
1
1
  {
2
2
  "name": "@jakebailey/dprint-plugin-gofumpt",
3
- "version": "0.0.1",
4
- "description": "OIDC trusted publishing setup package for @jakebailey/dprint-plugin-gofumpt",
3
+ "version": "0.0.13",
4
+ "description": "Wasm module for dprint-plugin-gofumpt, a dprint plugin for formatting Go code with gofumpt.",
5
+ "main": "./index.js",
6
+ "types": "./index.d.ts",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/jakebailey/dprint-plugin-gofumpt.git"
10
+ },
5
11
  "keywords": [
6
- "oidc",
7
- "trusted-publishing",
8
- "setup"
9
- ]
10
- }
12
+ "go",
13
+ "gofumpt",
14
+ "gofmt",
15
+ "code",
16
+ "formatter",
17
+ "dprint"
18
+ ],
19
+ "author": "Jake Bailey",
20
+ "license": "MIT",
21
+ "bugs": {
22
+ "url": "https://github.com/jakebailey/dprint-plugin-gofumpt/issues"
23
+ },
24
+ "homepage": "https://github.com/jakebailey/dprint-plugin-gofumpt#readme",
25
+ "files": [
26
+ "index.js",
27
+ "index.d.ts",
28
+ "plugin.wasm",
29
+ "metadata/LICENSES"
30
+ ],
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "devDependencies": {
35
+ "@changesets/cli": "^2.31.0",
36
+ "@dprint/formatter": "^0.5.1",
37
+ "@types/node": "^26.0.1",
38
+ "binaryen": "^130.0.0",
39
+ "dprint": "^0.55.1",
40
+ "hereby": "^1.15.1",
41
+ "typescript": "^6.0.3"
42
+ },
43
+ "scripts": {
44
+ "typecheck": "tsc",
45
+ "version": "changeset version && hereby metadata"
46
+ }
47
+ }
package/plugin.wasm ADDED
Binary file