You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We want to enable per-rule suppressions. This raises a number of complex issues:
What is the scope of a suppression? A "rule", or perhaps a "sub-rule" since existing rules like FolderStructure are actually many individual checks (with different error messages)? If the scope is limited to a "rule", then any rule that wants to be suppressable must be scoped to a single check.
Should all rules be suppressable? Or should it be opt-in? If opt-in, should it be an explicit flag on the rule, or just part of the rule implementation?
Currently, rules run in order, cannot be suppressed, and fail-fast. This allows later rules to assume the spec is valid per earlier rules, and prevents users from getting confusing error messages if their spec is totally invalid. If earlier rules are be suppressed, later rules may fail with confusing error messages or exceptions.
The text was updated successfully, but these errors were encountered:
mikeharder
changed the title
[TypeSpecValidation] Replace mock tests with in-proc end-to-end tests
[TypeSpecValidation] Refactor to prepare for per-rule suppressions
Dec 13, 2024
mikeharder
changed the title
[TypeSpecValidation] Refactor to prepare for per-rule suppressions
[TypeSpecValidation] Enable per-rule suppressions
Dec 13, 2024
Potential Option: Migrate tool to use ESLint as a backend, to "analyze file tspconfig.yaml", which can do arbitrary things like run "tsp compile" in response to elements in config like "typespec-autorest". The tsv frontend would just be responsible for finding the tspconfig.yaml file(s) to "lint", and checking the very basics like using tspconfig.yml instead of tspconfig.yaml.
The tsv tool currently has some code to handle running directly against a .Shared folder without a tspconfig.yaml, however:
It doesn't work in practice (fails on contoso)
Get-TypeSpec-Folders.ps1 only returns folders containing tspconfig.yaml (plus possible typos), so it's unlike a user would ever run tsv directly on a shared folder.
So, it should be sufficient for the eslint-based TSV to use tspconfig.yaml as it's entry point to all other checks.
We want to enable per-rule suppressions. This raises a number of complex issues:
FolderStructure
are actually many individual checks (with different error messages)? If the scope is limited to a "rule", then any rule that wants to be suppressable must be scoped to a single check.The text was updated successfully, but these errors were encountered: