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

Do not error when baseline is generated when all errors are fixed #751

Closed
wants to merge 1 commit into from

Conversation

alexander-schranz
Copy link

@alexander-schranz alexander-schranz commented Nov 1, 2021

I'm not sure if there is more needed. When I updated Jan0707/phpstan-prophecy#266 to phpstan 1.0 I found out after I fixed all errors phpstan will error that it can not update the baseline when there are 0 errors. I think it would great if it update the baseline with an empty array and so not exit 1 when there are no errors found.

@ondrejmirtes
Copy link
Member

Hi, what's the point of an empty baseline? You can simply remove the file and the includes :)

@alexander-schranz
Copy link
Author

@ondrejmirtes I think it is no error to have an empty baseline and so the command should not fail.

@alexander-schranz alexander-schranz deleted the patch-1 branch November 3, 2021 15:46
@Lctrs
Copy link
Contributor

Lctrs commented Nov 3, 2021

@ondrejmirtes That makes it difficult to script it.

@Lctrs
Copy link
Contributor

Lctrs commented Nov 18, 2021

@ondrejmirtes May you please reconsider your position on this ? Projects are not set in stone, baseline can have to be recreated again. I would really like to just run make generate-baseline and have a working install, whether my baseline is empty or not.

Currently with PHPStan 1.0, this is very cumbersome to do.

@ondrejmirtes
Copy link
Member

I'd accept a PR with "--allow-empty-baseline" CLI option that would make the exit code 0 in this case.

@ondrejmirtes
Copy link
Member

Solved: #776

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants