Skip to content

Conversation

kiukchung
Copy link
Contributor

@kiukchung kiukchung commented Nov 26, 2024

The PYRE check for lintrunner doesn't check the return code of running subprocess.run(["pyre", "--output=json", "incremental"]) therefore will try to parse the content of the command's console output as json even if the command fails.

This results in the propagated error message being non-descriptive.

Before

Before the change pyre --output=json incremental failing would result in:

$ lintrunner
Warning: Could not find a lintrunner config at: '.lintrunner.private.toml'. Continuing without using configuration file.


>>> General linter failure:

  Advice (pyre) command-failed
    Failed due to JSONDecodeError:
    Expecting value: line 1 column 1 (char 0)

After

After this fix, we get the proper root cause

$ lintrunner

>>> General linter failure:

  Advice (pyre) command-failed
    Failed due to CalledProcessError:
    Command '['pyre', '--output=json', 'incremental']' returned non-zero exit
    status 2.

@kiukchung kiukchung requested a review from d4l3k November 26, 2024 21:58
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 26, 2024
@kiukchung
Copy link
Contributor Author

hmmm nvm this doesn't work since pyre will exit with a non-zero exit code when there are type checking errors.

@kiukchung kiukchung closed this Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants