Skip to content
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

Implement multiple validate #1648

Merged
merged 4 commits into from
Dec 5, 2023
Merged

Implement multiple validate #1648

merged 4 commits into from
Dec 5, 2023

Conversation

ksss
Copy link
Collaborator

@ksss ksss commented Nov 26, 2023

fix #1543

Canges of API

Add RBS::CLI::Validate

I consolidated the behavior for validation into a single class, making it easier to divide the code using methods and such.

Add RBS::WillSyntaxError

By transitioning from printing strings to using error classes, I've made it possible to display parts of the code using detailed_message.

Changes of CLI

Report by logger

By changing from direct display to stdout to using a logger, I've made it possible to differentiate displays by adjusting log levels.

--silent is deprecated

With the introduction of log levels, the --silent option has become redundant, so I have marked it for deprecation.

Details of Behavior for Different Options

no option

It will report as many validation errors as possible. Warnings and errors are separated by log levels.
If there is even one error, the process will end with exit 1.

--fail-fast

If validation fails, it will be reported immediately and the process will end. This is similar to the traditional individual validation.

--exit-error-on-syntax-error

It will report all errors, including syntax errors, but if there is even one syntax error, the process will terminate with exit 1.

--fail-fast --exit-error-on-syntax-error

Even syntax errors, which would not normally be considered failures, will be treated as errors and the process will immediately terminate with exit 1.

**no option**

It will report as many validation errors as possible.
Warnings and errors are separated by log levels.
If there is even one error, the process will end with `exit 1`.

**--fail-fast**

If validation fails, it will be reported immediately and the process will end.
This is similar to the traditional individual validation.

**--exit-error-on-syntax-error**

It will report all errors, including syntax errors,
but if there is even one syntax error, the process will terminate with `exit 1`.

**--fail-fast --exit-error-on-syntax-error**

Even syntax errors, which would not normally be considered failures,
will be treated as errors and the process will immediately terminate with `exit 1`.
@soutaro soutaro added this to the RBS 3.4 milestone Dec 4, 2023
Copy link
Member

@soutaro soutaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ksss Thanks! Added two commits for minor fix.

@soutaro soutaro added this pull request to the merge queue Dec 5, 2023
Merged via the queue into ruby:master with commit 735bb94 Dec 5, 2023
24 checks passed
@ksss ksss deleted the multiple-validate branch December 5, 2023 08:44
soutaro added a commit that referenced this pull request Dec 20, 2023
This reverts commit 735bb94, reversing
changes made to 4e2a406.
@soutaro soutaro added the Released PRs already included in the released version label Dec 21, 2023
kachick added a commit to kachick/ruby-ulid that referenced this pull request Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released PRs already included in the released version
Development

Successfully merging this pull request may close these issues.

Feature proposal: Multiple error on rbs validate
2 participants