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

-vet-tabs may not work under some circumstances #4076

Closed
Feoramund opened this issue Aug 13, 2024 · 2 comments
Closed

-vet-tabs may not work under some circumstances #4076

Feoramund opened this issue Aug 13, 2024 · 2 comments

Comments

@Feoramund
Copy link
Contributor

package main

import "core:fmt"

Hello :: enum {
	I_am_tabbed_out,
    I_am_spaced_out,
        I_am_way_spaced_out,
I_am_none_of_these,
}

Struct :: struct {
	tabbed_out: int,
    spaced_out: int,
        way_spaced_out: int,
none_of_it: int,
}

main :: proc() {
	fmt.println(Hello.I_am_none_of_these)
  fmt.println("But I am in violation of the law.") // <-- `-vet-tabs` catches this,
    fmt.println("Me too.")                         // <-- and this.
fmt.println("But not me.")
}

I found that -vet-tabs does not evaluate enums or structs, and it ignores lines in procedures with no identation at all.

Specific command used here: odin check bad-vet-tabs.odin -file -vet -strict-style -vet-tabs

@gingerBill
Copy link
Member

So this may or may not be a bug because it cannot catch it in all cases generally. It could still be a form of alignment. I'll keep this open if it actually is an issue.

@gingerBill
Copy link
Member

Loads of improvements have been added to 8ba87e0

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

No branches or pull requests

2 participants