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 when module has @def attribute #75

Closed
randycoulman opened this issue Sep 15, 2023 · 1 comment
Closed

StyleError when module has @def attribute #75

randycoulman opened this issue Sep 15, 2023 · 1 comment

Comments

@randycoulman
Copy link

randycoulman commented Sep 15, 2023

Versions

  • Elixir: use elixir --version
Erlang/OTP 26 [erts-14.0.2] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]

Elixir 1.15.5 (compiled with Erlang/OTP 26)
  • Styler: use mix deps | grep locked | grep styler
  locked at 0.9.1 (styler) 28e3bb66

Example Input

https://github.com/randycoulman/mix_test_interactive/blob/v1.2.2/test/mix_test_interactive/pattern_filter_test.exs

I confirmed that the @def attribute in that file is the problem by renaming it to something else. When I did that, the problem went away.

Stacktrace / Current Behaviour

** (Styler.StyleError) Error running style Defs on test/mix_test_interactive/pattern_filter_test.exs
   Please consider opening an issue at: https://github.com/adobe/elixir-styler/issues/new
** (ArgumentError) ranges (first..last) expect both sides to be integers, got: 8..nil

    (elixir 1.15.5) lib/range.ex:193: Range.new/2
    (styler 0.9.1) lib/style/defs.ex:54: Styler.Style.Defs.run/2
    (styler 0.9.1) lib/zipper.ex:345: Styler.Zipper.do_traverse_while/3
    (styler 0.9.1) lib/styler.ex:36: anonymous fn/4 in Styler.style/3
    (elixir 1.15.5) lib/enum.ex:2510: Enum."-reduce/3-lists^foldl/2-0-"/3
    (styler 0.9.1) lib/styler.ex:34: Styler.style/3
    (styler 0.9.1) lib/styler.ex:64: Styler.format/3
    (elixir 1.15.5) lib/enum.ex:2510: Enum."-reduce/3-lists^foldl/2-0-"/3

Skipping style and continuing on
@novaugust
Copy link
Contributor

Thanks for the issue! v0.9.2 released with the fix =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants