-
Notifications
You must be signed in to change notification settings - Fork 92
Support pretty diagnostic messages in CLI #908
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
Open
danaetroupe
wants to merge
8
commits into
JohnnyMorganz:main
Choose a base branch
from
danaetroupe:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
be6e889
error-reporter
danaetroupe 46555e5
[unstable] checkpoint
danaetroupe 6b7b55a
- Made small changes to original Reporter.hpp for compatability
danaetroupe 1343150
Merge branch 'JohnnyMorganz:main' into main
danaetroupe 4b7880c
luau update
danaetroupe 0d7f3e8
Merge remote-tracking branch 'upstream/main'
danaetroupe d719f30
Revert to base
danaetroupe a44846b
extern updates
danaetroupe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,4 +49,7 @@ trace.json | |
| *.app | ||
|
|
||
| # Python venvs | ||
| .venv | ||
| .venv | ||
|
|
||
| # Test File | ||
| discard.luau | ||
danaetroupe marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| #include "Analyze/AnalyzeCli.hpp" | ||
| #include "Analyze/CliConfigurationParser.hpp" | ||
| #include "Analyze/CliClient.hpp" | ||
| #include "Analyze/Reporter.hpp" | ||
| #include "Flags.hpp" | ||
|
|
||
| #include "LSP/ClientConfiguration.hpp" | ||
|
|
@@ -29,6 +30,7 @@ enum class ReportFormat | |
| Default, | ||
| Luacheck, | ||
| Gnu, | ||
| Prettier | ||
| }; | ||
|
|
||
| static void report(ReportFormat format, const char* name, const Luau::Location& loc, const char* type, const char* message) | ||
|
|
@@ -54,6 +56,15 @@ static void report(ReportFormat format, const char* name, const Luau::Location& | |
| // Note: GNU end column is inclusive but our end column is exclusive | ||
| fprintf(stderr, "%s:%d.%d-%d.%d: %s: %s\n", name, loc.begin.line + 1, loc.begin.column + 1, loc.end.line + 1, loc.end.column, type, message); | ||
| break; | ||
|
|
||
| case ReportFormat::Prettier: | ||
| // Use Reporter.hpp to create new reporter error | ||
| auto file = new reporter::SimpleFile(name); | ||
| auto err = reporter::Error( | ||
| type, message, | ||
|
||
| { loc.begin.line, loc.begin.column, loc.end.column, file } | ||
| ); | ||
| err.print(std::cerr); | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -221,6 +232,8 @@ int startAnalyze(const argparse::ArgumentParser& program) | |
| format = ReportFormat::Luacheck; | ||
| else if (reportFormatter == "gnu") | ||
| format = ReportFormat::Gnu; | ||
| else if (reportFormatter == "prettier") | ||
| format = ReportFormat::Prettier; | ||
|
|
||
| #if !defined(LUAU_ENABLE_TIME_TRACE) | ||
| if (FFlag::DebugLuauTimeTracing) | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.