-
-
Notifications
You must be signed in to change notification settings - Fork 29
refactor: update headless payload to be config-based instead of file-based #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: update headless payload to be config-based instead of file-based #182
Conversation
How to use the Graphite Merge QueueAdd the label 0-merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
0d84bbb to
5fbdc6c
Compare
camc314
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. I'll merge this monday when i'm less tired and have re-reviewed with a fresh pair of eyes
b342f4b to
470f1da
Compare
470f1da to
581982c
Compare
581982c to
788d754
Compare
788d754 to
fcaf6c1
Compare
fcaf6c1 to
400bf44
Compare
400bf44 to
ff886b9
Compare
ff886b9 to
5e99d9e
Compare
b59efbc to
adde814
Compare
5e99d9e to
4989e6e
Compare
4989e6e to
3bffc86
Compare
f200896 to
5067784
Compare
Merge activity
|
7885aba to
4d07dfd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the headless payload format from file-based to config-based, introducing a new version 2 format while maintaining backward compatibility with version 1. The new format allows multiple files to be grouped under a single configuration with shared rules, reducing redundancy.
- Updates headless payload structure to use configs containing file paths and rules instead of individual file configurations
- Implements backward compatibility for version 1 payloads by converting them to version 2 format
- Updates test utilities and fixtures to use the new config-based format
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cmd/tsgolint/payload.go | New file implementing payload deserialization with version handling and V1 to V2 conversion |
| cmd/tsgolint/headless.go | Updated to use new payload format and removed old struct definitions |
| e2e/snapshot.test.ts | Updated test utilities to generate V2 payloads and added backward compatibility test |
| internal/linter/linter.go | Minor formatting change removing extra blank line |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
4d07dfd to
366a6bb
Compare
…based (#182) - based on #125 (cc @camc314) I took @camc314's branch and updated based on the latest code. I'm not familiar with Go, so it's very possible I've made some mistakes here, please review carefully 🙏 The goal of this PR is to ultimately enable doing custom configurations for rules without needing to specify redudant rule information. The new config format emphasizes configs over files, where each config defines a set of files it should apply to, and the rules that should be run.
366a6bb to
707c5e7
Compare
- oxc side of oxc-project/tsgolint#182 Updates the payload that `oxlint` sends to `tsgolint` to match the new format. The new structure is based around sets of rules and configurations first, and then specifying the files those configs act upon. That looks like something like this (output from running `oxlint --type-aware apps/oxlint/fixtures`) ```json { "configs": [ { "file_paths": [ "/Users/<user>/workspace/oxc/apps/oxlint/fixtures/tsgolint/use-unknown-in-catch-callback-variable/index.ts", "/Users/<user>/workspace/oxc/apps/oxlint/fixtures/tsgolint/prefer-reduce-type-parameter/index.ts", "/Users/<user>/workspace/oxc/apps/oxlint/fixtures/tsgolint/return-await/index.ts", "/Users/<user>/workspace/oxc/apps/oxlint/fixtures/tsgolint/non-tsgolint.ts", "..." "/Users/<user>/workspace/oxc/apps/oxlint/fixtures/tsgolint/no-unnecessary-template-expression/index.ts", "/Users/<user>/workspace/oxc/apps/oxlint/fixtures/tsgolint/no-unsafe-type-assertion/index.ts", "/Users/<user>/workspace/oxc/apps/oxlint/fixtures/tsgolint/no-unsafe-member-access/index.ts", "/Users/<user>/workspace/oxc/apps/oxlint/fixtures/tsgolint/no-unsafe-call/index.ts", "/Users/<user>/workspace/oxc/apps/oxlint/fixtures/tsgolint/no-unnecessary-boolean-literal-compare/index.ts" ], "rules": [ { "name": "await-thenable" }, { "name": "no-floating-promises" }, { "name": "no-array-delete" }, { "name": "no-base-to-string" }, { "name": "no-confusing-void-expression" }, { "name": "no-duplicate-type-constituents" }, { "...": "..."}, { "name": "restrict-plus-operands" }, { "name": "restrict-template-expressions" }, { "name": "return-await" }, { "name": "switch-exhaustiveness-check" }, { "name": "unbound-method" }, { "name": "use-unknown-in-catch-callback-variable" } ] }, { "file_paths": [ "/Users/<user>/workspace/oxc/apps/oxlint/fixtures/tsgolint/no-floating-promises/src/index.ts", "/Users/<user>/workspace/oxc/apps/oxlint/fixtures/tsgolint/no-floating-promises/src/overrides.ts" ], "rules": [{ "name": "no-floating-promises" }] } ] } ```

I took @camc314's branch and updated based on the latest code. I'm not familiar with Go, so it's very possible I've made some mistakes here, please review carefully 🙏
The goal of this PR is to ultimately enable doing custom configurations for rules without needing to specify redudant rule information. The new config format emphasizes configs over files, where each config defines a set of files it should apply to, and the rules that should be run.