Skip to content

Commit

Permalink
fix: linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
topaxi committed Oct 28, 2024
1 parent 536b09f commit 0948753
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions lua/lualine/components/gh-actions.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
local function store()
return require('gh-actions.store')
end

local function icons()
return require('gh-actions.utils.icons')
end

local function gh()
return require('gh-actions.github')
end
Expand All @@ -23,6 +15,8 @@ function component:init(options)
component.super.init(self, options)

self.options = vim.tbl_deep_extend('force', default_options, options or {})
self.store = require('gh-actions.store')
self.icons = require('gh-actions.utils.icons')

local server, repo = gh().get_current_repository()

Expand All @@ -32,14 +26,14 @@ function component:init(options)

require('gh-actions').start_polling()

store().on_update(function()
self.store.on_update(function()
require('lualine').refresh()
end)
end

---@override
function component:update_status()
local state = store().get_state()
local state = self.store.get_state()

local latest_workflow_run = state.workflow_runs and state.workflow_runs[1]
or {}
Expand All @@ -48,7 +42,7 @@ function component:update_status()
return ''
end

return icons().get_workflow_run_icon(latest_workflow_run)
return self.icons.get_workflow_run_icon(latest_workflow_run)
.. ' '
.. latest_workflow_run.name
end
Expand Down

0 comments on commit 0948753

Please sign in to comment.