Skip to content

Commit

Permalink
internals: improve error message when imports are found in a BUILD fi…
Browse files Browse the repository at this point in the history
…le or a macro (pantsbuild#17940)
  • Loading branch information
AlexTereshenkov authored Jan 7, 2023
1 parent 80502a6 commit 5a200e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/python/pants/engine/internals/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ def error_on_imports(build_file_content: str, filepath: str) -> None:
continue
raise ParseError(
f"Import used in {filepath} at line {lineno}. Import statements are banned in "
"BUILD files because they can easily break Pants caching and lead to stale results. "
f"\n\nInstead, consider writing a macro ({doc_url('macros')}) or "
f"writing a plugin ({doc_url('plugins-overview')}."
"BUILD files and macros (that act like a normal BUILD file) because they can easily "
"break Pants caching and lead to stale results. "
f"\n\nInstead, consider writing a plugin ({doc_url('plugins-overview')})."
)


Expand Down

0 comments on commit 5a200e8

Please sign in to comment.