Closed sasa-buklijas closed 8 months ago
your file contains no syntax errors. notice how your error is NameError
and not SyntaxError
try putting a $
in your source somewhere (as it's not a valid token in python yet) and you'll see a SyntaxError
your file contains no syntax errors. notice how your error is
NameError
and notSyntaxError
try putting a
$
in your source somewhere (as it's not a valid token in python yet) and you'll see aSyntaxError
Understand that, but still wondering what is what is use/idea of check-ast ? Do not see use in production or am I missing something ?
have you tried searching the issue tracker or the git history for the answer?
honestly not, only quick google search, would expect link in readme.
ok if you're not going to put in basic effort to answer your questions I hope you can see why I am not going to put in basic effort to help you
All I am saying if there is addition info regarding check-ast I see not harm in providing it in readme, as text or link.
Do not thing that I am the only one when reads "Simply check whether files parse as valid python." assumes that this means that it can be used for fast check of program.
All the best.
Do not thing that I am the only one when reads "Simply check whether files parse as valid python." assumes that this means that it can be used for fast check of program.
your read is completely correct but you don't know what a syntax error is and it's not the readme's job to teach you a basic concept of programming
or it could but the readme would become a cookbook sized document of mostly useless information
By reading https://github.com/pre-commit/pre-commit-hooks?tab=readme-ov-file#check-ast, my understanding is that it check if file is valid python.
I have done test with following file:
And result is:
I understand that there are better tool for checking python files/syntax, but just like to understand what is idea behind it ?