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

[Sweep Rules] Improve variable naming in lua/hurl/main.lua #121

Closed
wants to merge 8 commits into from

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented Mar 13, 2024

PR Feedback (click)

  • 👍 Sweep Did Well
  • 👎 Sweep Needs Improvement

I created this PR to address this rule:

"Variable and function names should be meaningful and descriptive."

Description

This PR improves the variable naming in the lua/hurl/main.lua file of the hurl.nvim repository. The variable head_state has been renamed to response_state to provide a more descriptive name that accurately reflects its purpose in the code.

Summary of Changes

  • Renamed the variable head_state to response_state throughout the lua/hurl/main.lua file.
  • Updated all references to the head_state variable to response_state.
  • Updated the condition if head_state == 'body' to if response_state == 'body'.
  • Updated the assignment head_state = 'start' to response_state = 'start'.
  • Updated the condition elseif head_state == 'body' to elseif response_state == 'body'.
  • Updated the assignment local key, value = string.match(line, '([%w-]+):%s*(.+)') to local key, value = string.match(line, '([%w-]+):%s*(.+)').
  • Updated the assignment response.body = response.body .. line to response.body = response.body .. line.
  • Updated the log statement 'hurl: response status ' .. response.status to 'hurl: response status ' .. response.status.
  • Updated the log statement 'hurl: response headers ' .. vim.inspect(response.headers) to 'hurl: response headers ' .. vim.inspect(response.headers).
  • Updated the log statement 'hurl: response body ' .. response.body to 'hurl: response body ' .. response.body.

Please review and merge this PR to improve the variable naming in the lua/hurl/main.lua file.

Copy link
Contributor Author

sweep-ai bot commented Mar 13, 2024

Rollback Files For Sweep

  • Rollback changes to lua/hurl/main.lua
  • Rollback changes to lua/hurl/main.lua
  • Rollback changes to lua/hurl/main.lua
  • Rollback changes to lua/hurl/main.lua
  • Rollback changes to lua/hurl/main.lua
  • Rollback changes to lua/hurl/main.lua
  • Rollback changes to lua/hurl/main.lua
  • Rollback changes to lua/hurl/main.lua
  • Rollback changes to lua/hurl/main.lua
  • Rollback changes to lua/hurl/main.lua
  • Rollback changes to lua/hurl/main.lua
  • Rollback changes to lua/hurl/main.lua
  • Rollback changes to lua/hurl/main.lua
  • Rollback changes to lua/hurl/main.lua

@sweep-ai sweep-ai bot added the sweep label Mar 13, 2024
Copy link

changeset-bot bot commented Mar 13, 2024

⚠️ No Changeset found

Latest commit: 58f83b8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@jellydn jellydn closed this Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant