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

fix[ux]: add missing filename to syntax exceptions #4343

Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4425feb
add path info to syntax exception
sandbubbles Nov 1, 2024
3316865
set path for natspec exceptions
sandbubbles Nov 1, 2024
90723e1
lint
sandbubbles Nov 2, 2024
bdf5a42
rewrite the path attribute
sandbubbles Nov 2, 2024
363cf1d
test natspec exception contains file
sandbubbles Nov 2, 2024
241511b
test version exception contains filename
sandbubbles Nov 2, 2024
b3c8ef5
test imported invalid compiler version is attributed correctly
sandbubbles Nov 2, 2024
02c5765
check syntax exception in json contains filename
sandbubbles Nov 2, 2024
548d583
check the exception is attributed to the correct file
sandbubbles Nov 2, 2024
67dcfb8
test syntax exceptions report file correctly
sandbubbles Nov 2, 2024
2dded1a
fix isort errors
sandbubbles Nov 4, 2024
2dfa033
refactor[ux]: add `venom` as `experimental-codegen` alias (#4337)
sandbubbles Nov 5, 2024
5637913
fix[ci]: fix README encoding in `setup.py` (#4348)
charles-cooper Nov 5, 2024
b6591b4
feat[docs]: add Telegram badge to README.md (#4342)
rafael-abuawad Nov 5, 2024
9450428
extract adding contract info into a function
sandbubbles Nov 7, 2024
97b3abe
update error message verification to include line number
sandbubbles Nov 7, 2024
1b0e02a
Merge branch 'master' into fix/syntax-exception-missing-filename
charles-cooper Nov 19, 2024
05e24d6
wrap parse_natspec in a try catch to add path
sandbubbles Nov 21, 2024
5101a27
remove changes to _annotate functions
sandbubbles Nov 21, 2024
7f44b10
rename method to "_format_contract_details"
sandbubbles Nov 21, 2024
88174e7
lint
sandbubbles Nov 21, 2024
e66da98
remove redundant "pass"
sandbubbles Nov 21, 2024
bf3ee5b
change path to resolved_path in exceptions
sandbubbles Nov 21, 2024
bd0d2d3
wrap path in safe_relpath
sandbubbles Nov 21, 2024
b6adc0b
lint
sandbubbles Nov 21, 2024
43edf77
add chdir_tmp_path to test fixtures and remove wildcards
sandbubbles Nov 21, 2024
96bac14
remove chdir_tmp_path when make_input_bundle is not used
sandbubbles Nov 21, 2024
af391a6
check resolved_path is not unknown
sandbubbles Dec 7, 2024
c09dc65
use only the msg of SyntaxError
sandbubbles Dec 7, 2024
6ca0cbb
Merge branch 'master' into fix/syntax-exception-missing-filename
sandbubbles Dec 7, 2024
fd8d78d
adjust the offset by 1
sandbubbles Dec 7, 2024
78362e6
test offset points to correct place
sandbubbles Dec 7, 2024
5ea4e2c
add comment
sandbubbles Dec 7, 2024
5022cfd
nits
charles-cooper Dec 13, 2024
7f0b3f4
fix lint
charles-cooper Dec 13, 2024
531cdca
move comment
charles-cooper Dec 13, 2024
8e87405
Merge branch 'master' into fix/syntax-exception-missing-filename
charles-cooper Dec 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move comment
charles-cooper committed Dec 13, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 531cdca55dbbeb70cbc26b524da617ca142445e2
4 changes: 2 additions & 2 deletions vyper/ast/parse.py
Original file line number Diff line number Diff line change
@@ -76,10 +76,10 @@ def _parse_to_ast_with_settings(
py_ast = python_ast.parse(pre_parser.reformatted_code)
except SyntaxError as e:
# TODO: Ensure 1-to-1 match of source_code:reformatted_code SyntaxErrors
# SyntaxError offset is 1-based, not 0-based (see:
# https://docs.python.org/3/library/exceptions.html#SyntaxError.offset)
offset = e.offset
if offset is not None:
# SyntaxError offset is 1-based, not 0-based (see:
# https://docs.python.org/3/library/exceptions.html#SyntaxError.offset)
offset -= 1
raise SyntaxException(str(e.msg), vyper_source, e.lineno, offset) from None