Skip to content
This repository has been archived by the owner on Apr 10, 2019. It is now read-only.

Convert default linter config from separate maps to a single map of linterConfig #322

Merged
merged 3 commits into from
Jul 31, 2017

Conversation

dnephin
Copy link
Collaborator

@dnephin dnephin commented Jul 17, 2017

With this change it should be easier to see the properties of a specific linter.

I think this change will enable us to support a full linter definition from the config format. Instead of just a list of strings in the form of name: spec, we could support a list of boths strings and LinterConfig objects. That would allow a user to fully customize a linter, including setting the partition strategy.

If we read the config during --install it would also let them set an InstallFrom.

Copy link
Owner

@alecthomas alecthomas left a comment

Choose a reason for hiding this comment

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

Very nice, thanks! Just one minor change and feel free to merge it.

linters.go Outdated
Pattern string
InstallFrom string
PartitionStrategy partitionStrategy
IsSlow bool
Copy link
Owner

Choose a reason for hiding this comment

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

I think this should be inverted to IsFast, as most linters (unfortunately) are slow.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good linters are slow, there's not a lot you can do accurately with just the AST it seems. @mvdan started some work to provide interfaces to share work here https://github.com/mvdan/lint - and dominikh's megacheck helps to reuse the go-tools collection's work.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sounds good, will swap to IsFast

a common interface for linters sounds like an interesting idea

dnephin added 3 commits July 28, 2017 11:56
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
@dnephin
Copy link
Collaborator Author

dnephin commented Jul 28, 2017

rebased and included the change from #325

@dnephin dnephin force-pushed the declarative-config branch from 6f02a0d to 6042f35 Compare July 28, 2017 16:00
@alecthomas alecthomas merged commit 4d5e541 into alecthomas:master Jul 31, 2017
@dnephin dnephin deleted the declarative-config branch July 31, 2017 14:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants