clippy-service icon indicating copy to clipboard operation
clippy-service copied to clipboard

Support custom feature configuration

Open gnunicorn opened this issue 9 years ago • 12 comments

Quoting @mcarton on #1:

Also tested it, it reports warning in a file guarded by

#![cfg_attr(feature="clippy", allow(float_cmp))]

Clippy is often used with a clippy, dev, nightly, testing or whatever feature in the wild, does the service have a way to compile with a given feature?

gnunicorn avatar Mar 05 '16 17:03 gnunicorn

And to quote myself:

@Manishearth , @mcarton could you elaborate why the conf_attr things doesn't work in the rustc approach I am currently taking? And maybe what we can do about that? Is this because the we don't pass that config? I was thinking of allowing some customization of the rustc command via a .clippy.tomlin the same folder. There the owner could configure they want "feature" xyz, would that solve the issue?

gnunicorn avatar Mar 05 '16 17:03 gnunicorn

Note that Clippy might get a Clippy.toml file by itself (see https://github.com/Manishearth/rust-clippy/pull/698). Adding another .clippy.toml file would be confusing at best. If this is the way we choose, we could just add the conf there.

mcarton avatar Mar 05 '16 17:03 mcarton

@mcarton: good point. Will that config contain a way to configure said features from there?

gnunicorn avatar Mar 05 '16 17:03 gnunicorn

No, Clippy cannot change the features itself.

mcarton avatar Mar 05 '16 17:03 mcarton

Another option might be to include it in the URL, along with the repo and branch.

mrmonday avatar Mar 05 '16 19:03 mrmonday

At the same time, we could allow a [service] clippy-feature="nightly" key in the toml. Clippy itself can ignore it, but clippy-service reads it. No reason we can't share a conf file :smile:

Manishearth avatar Mar 06 '16 05:03 Manishearth

No reason we can't share a conf file

Of course, but with the current PR any unknown key is an error. Should I just white-list [service] (but then what about other tools?) or ignore all unknown keys (which means eg. spelling mistake in the conf file will be hard to notice).

mcarton avatar Mar 06 '16 10:03 mcarton

Nah, just whitelist [service]. Or we'll call it [third-party] or [external]

Manishearth avatar Mar 06 '16 10:03 Manishearth

Ok then, I’ve white-listed third-party, I preferred that name.

mcarton avatar Mar 06 '16 13:03 mcarton

Well, I wait for https://github.com/Manishearth/rust-clippy/pull/698 to be merged then. After that I will tackle this as part of the config-file milestone!

gnunicorn avatar Mar 07 '16 12:03 gnunicorn

https://github.com/Manishearth/rust-clippy/pull/698 has been merged. Any update on this?

indiv0 avatar Apr 16 '16 23:04 indiv0

@indiv0 no work on this yet (from my side), but I am accepting Pull-Requests :-) !

gnunicorn avatar Apr 16 '16 23:04 gnunicorn