8000 fix: ignore cgo files by ldez · Pull Request #167 · bombsimon/wsl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: ignore cgo files #167

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

Merged
merged 1 commit into from
Apr 3, 2025
Merged

Conversation

ldez
Copy link
@ldez ldez commented Apr 2, 2025

Reverts #159, #157

the cgo support is dropped, but the tests are kept to avoid regression.

Fixes #162

@ldez ldez force-pushed the fix/drop-cgo-support branch from 39827b7 to 4061863 Compare April 2, 2025 21:38
@ldez ldez force-pushed the fix/drop-cgo-support branch from 2629974 to 6bab1f5 Compare April 2, 2025 21:42
@coveralls
Copy link
coveralls commented Apr 2, 2025

Coverage Status

coverage: 94.196% (+0.006%) from 94.19%
when pulling 6bab1f5 on ldez:fix/drop-cgo-support
into da63f07 on bombsimon:master.

Comment on lines +91 to +94
// if the file is related to cgo the filename of the unadjusted position is a not a '.go' file.
if !strings.HasSuffix(fn, ".go") {
continue
}
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe we can just return pass.Fset.PositionFor(file.Pos(), false).Filename from getFilename, or even drop getFilename and just do this once? I don't think there's any need for first calling getFilename to get potential adjusted position/file and then again here to skip it.

Copy link
Author

Choose a reason for hiding this comment

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

if we do that, the line directive will not work.

Copy link
Author

Choose a reason for hiding this comment

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

For files with line directives:

  • adj: The filename is not a Go file
  • non-adj: The filename is a Go file

For files with cgo:

  • adj: The filename is a Go file
  • non-adj: The filename is not a Go file (but its' a Go file 😉)

@bombsimon bombsimon merged commit 8821107 into bombsimon:master Apr 3, 2025
4 checks passed
@ldez ldez deleted the fix/drop-cgo-support branch April 3, 2025 21:05
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.

False positive - cgo - block starting/ending with whitespaces
3 participants
0