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

operator_spaces handles +,- and / signs as operator in cases where it is not an operator #483

Closed
f3c0 opened this issue Jun 11, 2018 · 4 comments · Fixed by inaka/elvis_core#112

Comments

@f3c0
Copy link
Contributor

f3c0 commented Jun 11, 2018

I tried to force +, - and / operators with spaces before and after.
Unexpected behaviour:

  • all the signed numbers became invalid format
  • function references like function_name/2 have missing space message too

I've made a test repo for the bug: https://github.com/f3c0/elvis_test.git

$ git clone https://github.com/f3c0/elvis_test.git .
$ git checkout  test_operators_plus_minus_slash

$ elvis --version
   ______     _   
  / __/ /  __(_)__
 / _// / |/ / (_-<
/___/_/|___/_/___/
Version: 0.4.1
Elvis Core Version: 0.3.9

$ elvis rock
# src/elvis_test.erl [FAIL]
  - operator_spaces
    - Missing space right "/" on line 3
    - Missing space left "/" on line 3
    - Missing space right "-" on line 9
    - Missing space right "+" on line 11

@elbrujohalcon
Copy link
Member

You're right, this is a bug.

@f3c0
Copy link
Contributor Author

f3c0 commented Jun 11, 2018

I have a very similar problem with / sign.
Elvis handles it in the functions references like function_name/2 as slash operator.
Should I open as separated ticket, or just amend this?

@elbrujohalcon
Copy link
Member

We should solve them both together, so I would say just amend this one

@f3c0 f3c0 changed the title operator_spaces handles +/- signs as +/- operator operator_spaces handles +,- and / signs as operator in cases where it is not an operator Jun 12, 2018
@f3c0
Copy link
Contributor Author

f3c0 commented Jun 12, 2018

Thanks, I've just updated the original report

jfacorro added a commit to inaka/elvis_core that referenced this issue Nov 25, 2019
jfacorro added a commit to inaka/elvis_core that referenced this issue Nov 26, 2019
jfacorro added a commit to inaka/elvis_core that referenced this issue Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants