Azure / Azure/azure-sdk-tools

Improve PrettierCheck failures to make them more actionable

Open
#5,992 0 comments 0 reactions 1 assignee Claimed by @konrad-jamrozik View on GitHub
Central-EngSys feature-request Spec PR Tools
Dominant language
C#
Stars
135
Forks
260
Avg merge
1d 22h
Merged PRs (30d)
115

Description

Issues like this:

- https://github.com/Azure/azure-sdk-tools/issues/5928

Show that PrettierCheck failures are hard for users to self-fix. A PrettierCheck failure should generate a comment that provides a series of copy-pasteable instructions that will fix the error.

On an example of [this comment](https://github.com/Azure/azure-rest-api-specs/pull/22466#issuecomment-1504195124), the instructions could contain a dynamically generated code snippet like:

``` powershell
"cd to local clone"
"checkout appropriate local branch"
npx prettier -w "dynamically generated path to the offending file"
git push
```

The message could also explain the exact failure, which is currently hidden. The details can be obtained with `npx prettier -l`.

# Related work

- #6017
- https://github.com/Azure/azure-rest-api-specs/pull/23667

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.