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

StyleError for unused imports quotes almost entire file in output #781

Closed
yggdr opened this issue Aug 6, 2023 · 1 comment
Closed

StyleError for unused imports quotes almost entire file in output #781

yggdr opened this issue Aug 6, 2023 · 1 comment

Comments

@yggdr
Copy link

yggdr commented Aug 6, 2023

When coconut finds an unused import, it quotes an error location from the point of the import statement (hence, most likely near the top of the file), until the end of file, making the output unnecessarily large and loquacious.

  Compiling         src/rechnungen/commands/latex.coco ...
  CoconutWarning: --incremental mode is not currently supported for files as large as {codepath!r}
  in src/rechnungen/commands/latex.coco:
    CoconutStyleError: found unused import 'yaml' (add '# NOQA' to suppress) (remove --strict to downgrade to a warning) (line
   26 in 'latex.coco')
      /~~~~~~~~~~

      import yaml

      import jinja2

[snip ca. 200 lines...]

              out = str(output_path)
              outdir = str(output_path.parent)

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
  Coconut exiting with error: CoconutStyleError
@evhub evhub added this to the v3.0.4 milestone Aug 6, 2023
@evhub
Copy link
Owner

evhub commented Aug 6, 2023

Thanks for the bug report! Should be fixed as of coconut-develop>=3.0.3-post_dev6 (pip uninstall coconut and pip install -U coconut-develop).

@evhub evhub closed this as completed Aug 6, 2023
@evhub evhub mentioned this issue Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants