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(mason): update run regular expression to support long Dart formatting #1164

Merged
merged 11 commits into from Jan 2, 2024

Conversation

alestiago
Copy link
Collaborator

@alestiago alestiago commented Nov 23, 2023

Status

READY

Description

Resolves #1169


Updates the run regular expression to support long Dart formatting.

Future<void> run(HookContext context) {
}

// Before, this formatting wouldn't get matched:
Future<void> run(
  HookContext context, {
  FooObject fooObject= FooObject.foo,
})

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore

@felangel
Copy link
Owner

felangel commented Nov 27, 2023

Hi @alestiago 👋
Thanks for opening an issue!

// Before, this formatting wouldn't get matched:
Future<void> run(
  HookContext context, {
  FooObject fooObject= FooObject.foo,
})```

I don't think that's valid because that's not the correct signature for the run function. Can you please provide more context regarding what you're trying to achieve? Thanks!

@alestiago
Copy link
Collaborator Author

alestiago commented Nov 28, 2023

Hi @felangel ! Thanks for reaching back. The syntax allows for dependency injection (handy during testing the run function), currently this is already possible (as long as you avoid the formatter breaking the line)!

I've made an issue with reproductive steps, let me know what you think there, #1169 🙌

@alestiago
Copy link
Collaborator Author

@felangel any updates? Let me know what you think in #1169 🙌 💙

@felangel
Copy link
Owner

felangel commented Dec 7, 2023

@felangel any updates? Let me know what you think in #1169 🙌 💙

Sorry for the delay will have a look later today.

Co-authored-by: Felix Angelov <felangelov@gmail.com>
@felangel felangel changed the title fix: update run regular expression to support long Dart formatting fix(mason): update run regular expression to support long Dart formatting Jan 2, 2024
Copy link
Owner

@felangel felangel left a comment

Choose a reason for hiding this comment

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

LGTM ✅

@felangel felangel merged commit 860a1e9 into felangel:master Jan 2, 2024
12 checks passed
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.

fix: inconsistent run syntax behaviour
2 participants