Skip to content

Conversation

@jacobvosmaer
Copy link

Because clang-format is not used universally, this change adds a check so that we only run clang-format if a .clang-format file can be found higher up in the directory tree.

This is an alternative approach to #111. I find it gets tedious to define a filter for each file I open.

// The other known extensions and formatters are:
//
// .rs - rustfmt
//
Copy link
Author

Choose a reason for hiding this comment

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

This line got deleted, ironically, by acmego. I need to add a comment about .c and .h here.

".go": []string{"goimports"},
type formatter struct {
cmd []string
enabled func(string) bool
Copy link
Author

Choose a reason for hiding this comment

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

I suppose we could have a method Enabled() which returns true if this callback field is nil.

Because clang-format is not used universally, this change adds a check
so that we only run clang-format if a .clang-format file can be found
higher up in the directory tree.
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.

1 participant