Skip to content

Conversation

@glepnir
Copy link
Member

@glepnir glepnir commented Nov 8, 2025

migrate to upstream _async module

@glepnir glepnir requested a review from Copilot November 8, 2025 04:40
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the codebase to use an async/await pattern, replacing direct coroutine manipulation with a new async utility module. The changes modernize the asynchronous execution model for formatters and linters.

  • Introduces a new guard._async module providing async/await primitives
  • Refactors format.lua and lint.lua to use the new async utilities
  • Updates test fixtures to reflect command changes

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lua/guard/_async.lua New async utility module providing run, await, and join functions for coroutine management
lua/guard/format.lua Refactored to use async/await pattern, split formatter logic into pure/impure functions
lua/guard/lint.lua Migrated from spawn module to async pattern with new exec_linter function
spec/format_spec.lua Updated test to use sed instead of cat with modified arguments
Makefile Added test infrastructure using busted with luarocks

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <[email protected]>
@glepnir glepnir merged commit 92ff217 into main Nov 8, 2025
5 checks passed
@glepnir glepnir deleted the with_async branch November 9, 2025 05:13
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.

2 participants