Skip to content

Commit

Permalink
Use ProcessedSource#file_path
Browse files Browse the repository at this point in the history
  • Loading branch information
koic committed Jan 31, 2024
1 parent c27c74e commit 36a6b88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/rubocop/cop/lint/script_permission.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ def on_new_investigation
message = format_message_from(processed_source)

add_offense(comment, message: message) do
autocorrect(comment) if autocorrect_requested?
autocorrect if autocorrect_requested?
end
end

private

def autocorrect(comment)
FileUtils.chmod('+x', comment.source_range.source_buffer.name)
def autocorrect
FileUtils.chmod('+x', processed_source.file_path)
end

def executable?(processed_source)
Expand Down

0 comments on commit 36a6b88

Please sign in to comment.