-
-
Notifications
You must be signed in to change notification settings - Fork 27
feat: Pass fname and cwd to parse function #247
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 adds file path and working directory context to linter provider functions by passing fname and cwd parameters to both parse and fn functions. This enhancement allows custom linters to access file location information when processing lint results or generating lint output.
Changes:
- Updated
lint.parse()calls to includefnameandcwdparameters (lines 107, 122) - Updated
lint.fn()call to includefnameandcwdparameters (line 120)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Instead of fname, would bufid be a better choice? 🤔 Seems much more natural as an api. Could you remind me again why you need cwd? |
|
As I wrote in the issue: " Example with {
"format_version": "1.0",
"valid": true,
"error_count": 0,
"warning_count": 2075,
"diagnostics": [
{
"severity": "warning",
"summary": "Deprecated Resource",
"detail": "This resource is deprecated...",
"address": "module.some.module.address.abcd.name",
"range": {
"filename": ".terraform/modules/some.address/main.tf",
...
}
}
... other 2074 warnings
]
}
Regarding |
|
How about a get state function that runs outside of the coroutine? |
Both
parseandfnprovider functions now receivefnameandcwdparameters to provide file path and working directory context.