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

Add lint groups to Q# #2103

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add lint groups to Q# #2103

wants to merge 3 commits into from

Conversation

orpuente-MS
Copy link
Contributor

This PR adds the necessary infrastructure to define lint groups. It also adds the pedantic lint group.

A lint group can be added to the qsharp.json manifest as follows:

{
   "lints": [
      { "group": "pedantic", "level": "warn" }
   ]
}

#[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub enum LintGroup {
Pedantic,
Copy link
Member

Choose a reason for hiding this comment

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

Why "pedantic"?

It has a slightly negative connotation, like "so picky as to be annoying". I do know Clippy uses it, but I think the name makes some sense there: they have many other groups you would want to enable before pedantic. So this is the one that's like a bunch of opinionated lints we didn't know where else to put. Even their documentation hedges it by saying "if you enable this group, expect to also use #[allow] attributes generously"

If this is our only lint group, I don't think "pedantic" makes sense.

My other problem with the name is it doesn't describe a meaningful category or purpose. As a user, how can I tell what I'm getting out of these lints by opting into them?

Do we need groups? If we do, what about more functional categories like "correctness", "style", "deprecations" etc?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with you here, some extra color to the conversation: I think the pedantic lints in Clippy tend to be much more subjective and not as universally-accepted. I don't think the name pedantic conveys that, but maybe we can come up with a better word. Stylistic? Strict? Opinionated? I like opinionated as a group name.

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.

3 participants