-
Notifications
You must be signed in to change notification settings - Fork 519
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
DO NOT MERGE: travis: Run Clippy #445
Conversation
So question is whether to do anything about any of this. Whether to actually change anything as a result of the report. I think the primary focus should be on any in Things I think it'd be good to change soon:
Things that would be fine to change, but I'm not in a rush:
Things I'm not sure how I feel about:
|
... and also whether to merge this so results can be continually checked. Seems fine. |
This is cool! Might want to expand the README as well to let new contributors know that this information is available. I agree that using integer cents in book-store is high priority, and everything else can be touched up as people have time. Underscore-separated integer literals seem like a clear win to me. They aren't a feature that I've seen in other languages, but they're part of idiomatic Rust: otherwise, Clippy wouldn't have a lint for them. There's no learning barrier; it's immediately obvious what number is represented. The hardest part of all this will be writing a little script to parse the clippy results and replace the digits of the appropriate files. I'd argue that the slice type |
How I'll handle this: I'll create an issue for moving to integers in book-store soon. It is not guaranteed whether I will be the one doing that, or someone else. When I figure out what to write in the README, I will add to this PR accordingly. |
I think the second most important thing to tackle would be using |
I'm a little suspicious of this: https://travis-ci.org/exercism/rust/jobs/362332100 shows no Clippy lints on the tests. I was sure there should be some. For example, we used to get one suggesting underscores in integer literals such as in https://github.com/exercism/rust/blob/master/exercises/largest-series-product/tests/largest-series-product.rs#L49 . I will check whether that particular lint is simply |
Negative. It is |
... but it was increased to >5 digits. rust-lang/rust-clippy@e9d5a31 |
OK, well, now I know that Clippy lints from tests are definitely not showing up (whereas they used to!) Since I care more about tests than the examples, this threatens to make this PR useless unless there is a way to get them to show. |
Per rust-lang/rust-clippy#1436, we'd need to add the flags |
Last known build where Clippy was run on the tests (187, nightly = 2789b067d 2018-03-06): https://travis-ci.org/exercism/rust/jobs/352617705 Failed attempts: Clippy no longer builds these versions as of today (clippy says it needs to be built by the same nightly version of rustc, so I could consider going to those versions...?) nightly = fb44b4c0e 2018-04-04
Clippy demonstrably not running against tests: |
confirmed that 187 is checking tests. I'll binary search between 187 and 191 |
189: yes, does run against tests: https://travis-ci.org/exercism/rust/builds/362821482 |
190: yes does test https://travis-ci.org/exercism/rust/builds/362833754 |
191 did not lint tests. https://travis-ci.org/exercism/rust/builds/362854069 |
To see what we're seeing in our tests, I'll download the log (https://api.travis-ci.org/v3/job/362921121/log.txt) and run the following on it
Interesting. and we can do the same for our examples by looking for src/lib.rs.
|
I am sorry to report. I have gotten all the value I am going to get out of this PR (the IMO high priority lints). As of my last check, if I ran this on recent versions of clippy, I would get no lint output from the tests. I was unable to solve that. It does not make sense to keep on an old version of Rust+Clippy. I will confirm one last time, and close it. |
I believe this would have value. It would be good if all examples and tests were clean (as defined by Clippy), and that this were enforced by CI. We would have a long road to get there, but that can be done piecemeal. But we cannot even start if our tests are not checked. I will not be the person to solve this problem. Feel free to pick up from here and try to solve it. |
So. This PR is Interesting because it shows what could be, and we can use it to show current clippy items in tests and example solutions. The tests are higher priority because they are exposed to students, whereas the example solutions are lower priority. We could do some sort of staged enforcement, where:
By the way, here are clippy's current suggestions on the tests.
Given my available time and priorities, I'm not in the position to enact the above plan. So I will be closing this PR so that people don't give the wrong idea. However, it could be a good starting point for anyone else who might want to do the same. |
Huh, I seem to have solved that by using the This will be a "reopen, trigger Travis CI, generate report, close" operation. I make no guarantees about any future plans to do this, or that I will make any effort to automate it. |
Changes since last time I tried: It's now |
We are apparently not doing so bad on our tests!
As for the example solutions (remember that example solution gets moved to src/lib.rs before clippy is run)
Note that there is no provision right now that runs clippy for the stubs. All right this was interesting to see, so back to closing this now. |
I'll also look for tests:
example solns:
not bad at all on the tests. |
Need to change the line to remove the timestamp in front now that we moved to GitHub actions. New lines are:
|
As of submission time, this is an experiment and I don't know how well it will go, but we'll see.