Skip to content

config: Disable report_todo by default #798

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

Merged
merged 1 commit into from
Feb 15, 2016

Conversation

kamalmarhubi
Copy link
Contributor

No description provided.

@kamalmarhubi
Copy link
Contributor Author

I don't even think the feature belongs in rustfmt, but at the very least it should be off by default.

@nrc
Copy link
Member

nrc commented Feb 2, 2016

The motivation for this feature is parity with make tidy. Apart from that, I think it is good engineering practice to have an enforced separation of TODO and FIXME, the former meant to be temporary while a patch is written, the latter is allowed to land. This is a check on landing incomplete code.

I'm sympathetic to the argument that this is not really formatting, as such and so shouldn't be on by default, but I can't think of a better place for it to live and I don't believe there is more motivation for turning it off rather than leaving it on.

Do you have a use case for why it should be off by default?

I'm curious what others think about this too.

@kamalmarhubi
Copy link
Contributor Author

Why it should be off by default: TODO is a convention used in many ways by many projects. Forcing an interpretation is not the place of a formatting tool*.

Some examples of projects / organizations with different interpretations from the one in rustfmt:

  • Google C++ style guide: ‘Use TODO comments for code that is temporary, a short-term solution, or good-enough but not perfect.’
  • Cap'n Proto style guide: ‘release scripts can error out if release-blocking TODOs are present.’

Why it shouldn't be in rustfmt:: rustfmt is a formatting tool: it takes code in, and spits out better formatted code that abides by conventions. Reporting style deviations belongs in a lint tool.


* yes, a formatting tool is all about enforcing conventions. However, these are syntactic rather than semantic; enforcing an interpretation of TODO leans more towards semantic. :-)

@kamalmarhubi
Copy link
Contributor Author

Also, rustfmt currently gives 18 such warnings on its own code base!

@cassiersg
Copy link
Contributor

I agree rustfmt is not the ideal place to have this kind of lints. Maybe it is better to have that is clippy ?

@kamalmarhubi
Copy link
Contributor Author

clippy requires nightly which makes it a more difficult tool to recommend. I think a separate tool would make sense. Not sure if there is an existing rustlint but it would make sense I think. In the meantime, I'd just like this disabled :-)

@kamalmarhubi
Copy link
Contributor Author

ping :-)

@nrc
Copy link
Member

nrc commented Feb 15, 2016

I think rustfmt probably should be the tool for doing this, but I'm ok with it not being a default.

nrc added a commit that referenced this pull request Feb 15, 2016
@nrc nrc merged commit 65bc5c2 into rust-lang:master Feb 15, 2016
@kamalmarhubi
Copy link
Contributor Author

@nrc, rereading Design.md, and I saw this in there:

My long term goal is that all style lints can be moved from the compiler to
rustfmt and, as well as warning, can either fix problems or emit refactoring
scripts to do so.

so apologies for ignoring that. I wonder if the right approach is a family of tools that share a lot of implementation?

@nrc
Copy link
Member

nrc commented Mar 9, 2016

Yeah, I have been considering a less monolithic vision recently. I'm not exactly how it should work and how to make it ergonomic though.

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