[go: up one dir, main page]

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 Credo Trailing Whitespace #630

Merged
merged 3 commits into from
Oct 16, 2021
Merged

Fix Credo Trailing Whitespace #630

merged 3 commits into from
Oct 16, 2021

Conversation

mhanberg
Copy link
Member
@mhanberg mhanberg commented Sep 23, 2021

@rrrene looks like there are still a couple of spots with the trailing whitespace false positive.

Checking 28 source files ...

info: some checks were skipped because they're not compatible with
your version of Elixir (1.11.2).

You can deactivate these checks by adding this to the `checks` list in your config:

    {Credo.Check.Warning.LazyLogging, false},


  Code Readability                                                                                                                                                                                                                           
┃ 
┃ [R] ↘ There should be no trailing white-space at the end of a line.
┃       lib/wallaby/browser.ex:1072:1 #(Wallaby.Browser.has_text?)
┃ [R] ↘ There should be no trailing white-space at the end of a line.
┃       lib/wallaby/browser.ex:988:1 #(Wallaby.Browser.has?)
┃ [R] ↘ There should be no trailing white-space at the end of a line.
┃       lib/wallaby/browser.ex:963:1 #(Wallaby.Browser.find)

  Refactoring opportunities                                                                                                                                                                                                                  
┃ 
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:503 #(Wallaby.WebdriverClient.execute_script_async)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:491 #(Wallaby.WebdriverClient.execute_script)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:456 #(Wallaby.WebdriverClient.set_window_position)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:435 #(Wallaby.WebdriverClient.set_window_size)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:424 #(Wallaby.WebdriverClient.set_cookie)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:284 #(Wallaby.WebdriverClient.touch_scroll)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:273 #(Wallaby.WebdriverClient.touch_move)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:239 #(Wallaby.WebdriverClient.touch_down)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:213 #(Wallaby.WebdriverClient.move_mouse_to)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:684 #(Wallaby.WebdriverClient.alert_text)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:634 #(Wallaby.WebdriverClient.focus_parent_frame)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:624 #(Wallaby.WebdriverClient.focus_frame)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:612 #(Wallaby.WebdriverClient.focus_frame)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:599 #(Wallaby.WebdriverClient.close_window)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:578 #(Wallaby.WebdriverClient.focus_window)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:565 #(Wallaby.WebdriverClient.window_handle)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:555 #(Wallaby.WebdriverClient.window_handles)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:545 #(Wallaby.WebdriverClient.page_source)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:535 #(Wallaby.WebdriverClient.log)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:524 #(Wallaby.WebdriverClient.send_keys)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:517 #(Wallaby.WebdriverClient.send_keys)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:480 #(Wallaby.WebdriverClient.maximize_window)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:470 #(Wallaby.WebdriverClient.get_window_position)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:446 #(Wallaby.WebdriverClient.get_window_size)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:414 #(Wallaby.WebdriverClient.cookies)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:403 #(Wallaby.WebdriverClient.take_screenshot)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:393 #(Wallaby.WebdriverClient.rect)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:383 #(Wallaby.WebdriverClient.size)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:373 #(Wallaby.WebdriverClient.displayed)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:363 #(Wallaby.WebdriverClient.selected)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:349 #(Wallaby.WebdriverClient.current_path)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:339 #(Wallaby.WebdriverClient.current_url)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:319 #(Wallaby.WebdriverClient.attribute)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:309 #(Wallaby.WebdriverClient.page_title)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:299 #(Wallaby.WebdriverClient.text)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:262 #(Wallaby.WebdriverClient.tap)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:251 #(Wallaby.WebdriverClient.touch_up)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:179 #(Wallaby.WebdriverClient.button_up)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:165 #(Wallaby.WebdriverClient.button_down)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:151 #(Wallaby.WebdriverClient.double_click)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:140 #(Wallaby.WebdriverClient.click)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/webdriver_client.ex:127 #(Wallaby.WebdriverClient.click)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/selenium.ex:184 #(Wallaby.Selenium.current_path)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby/httpclient.ex:81 #(Wallaby.HTTPClient.handle_response)
┃ [F] ↗ `Enum.map_join/3` is more efficient than `Enum.map/2 |> Enum.join/2`
┃       lib/wallaby/helpers/key_codes.ex:57 #(Wallaby.Helpers.KeyCodes.json)
┃ [F] ↗ the last clause in `with` is redundant
┃       lib/wallaby.ex:92 #(Wallaby.end_session)

Please report incorrect results: https://github.com/rrrene/credo/issues

Analysis took 0.5 seconds (0.08s to load, 0.4s running 63 checks on 28 files)
611 mods/funs, found 46 refactoring opportunities, 3 code readability issues.

Use `mix credo explain` to explain issues, `mix credo --help` for options.

@rrrene
Copy link
rrrene commented Sep 23, 2021

Yeah, I made a mistake. Should not program that late. Will fix asap. Thx for your patience!

@mhanberg
Copy link
Member Author

No, thank you for being so helpful! I really appreciate it.

@rrrene
Copy link
rrrene commented Sep 24, 2021

I pushed another attempt to fix this situation. Could re-run this?

@mhanberg
Copy link
Member Author

@rrrene it seems to be fixed now!

@codecov-commenter
Copy link
codecov-commenter commented Sep 24, 2021

Codecov Report

Merging #630 (f90bd83) into main (e3e2a2f) will decrease coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #630      +/-   ##
==========================================
- Coverage   92.02%   91.95%   -0.08%     
==========================================
  Files          24       24              
  Lines         941      932       -9     
==========================================
- Hits          866      857       -9     
  Misses         75       75              
Flag Coverage Δ
IntegrationTest 87.55% <94.59%> (-0.12%) ⬇️
UnitTest 41.09% <86.48%> (-0.46%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
lib/event_emitter.ex 90.00% <ø> (ø)
lib/wallaby/browser.ex 94.50% <ø> (ø)
lib/wallaby.ex 100.00% <100.00%> (ø)
lib/wallaby/helpers/key_codes.ex 100.00% <100.00%> (ø)
lib/wallaby/httpclient.ex 100.00% <100.00%> (ø)
lib/wallaby/selenium.ex 76.54% <100.00%> (-0.29%) ⬇️
lib/wallaby/webdriver_client.ex 99.36% <100.00%> (-0.04%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e3e2a2f...f90bd83. Read the comment docs.

@rrrene
Copy link
rrrene commented Sep 24, 2021

The fix is now live in Credo 1.6.0-rc.1 👍

@mhanberg mhanberg merged commit 7ff1a00 into main Oct 16, 2021
@mhanberg mhanberg deleted the mh/credo-fix branch October 16, 2021 19:10
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

Successfully merging this pull request may close these issues.

3 participants