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

The regexp for rustfmt version detection looks incorrect #1970

Closed
StrayLightning opened this issue Dec 3, 2017 · 2 comments
Closed

The regexp for rustfmt version detection looks incorrect #1970

StrayLightning opened this issue Dec 3, 2017 · 2 comments
Assignees

Comments

@StrayLightning
Copy link

In atom-beautify/src/beautifiers/rustfmt.coffee the rustfmt version is checked to be 0.5.0 or later with the following regexp:

if /^0.(?:[0-4].[0-9])(?!-nightly)/.test(stdout.trim())

This looks incorrect, as it only matches a single digit for each version component. But beyond that the behaviour seems a bit strange to me, though I am not a coffeescript expert. If you happen to build rustfmt from the master branch at version 0.2.9, then atom-beautify will happily use that beautifier to format your Rust code. If you build rustfmt from the master branch at 0.2.10 or later, then atom-beautify will complain about the rustfmt version.

Note: The intended general usage of rustfmt might be to build it from the syntex branch, where the version is 0.9.0 at the time of writing, but the regexp still looks incorrect.

Steps to Reproduce

Build rustfmt from the master branch at tag 0.2.9 and configure atom-beautify to use it.

Expected behaviour: atom-beautify complains about the version of rustfmt.

Actual behaviour: atom-beautify happily reformats the Rust code.

@stale
Copy link

stale bot commented Feb 1, 2018

This issue has been automatically marked as stale because it has not had recent activity. If this is still an issue, please add a comment. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Feb 1, 2018
@stale stale bot closed this as completed Feb 8, 2018
@Glavin001
Copy link
Owner

Pull Requests welcome, @StrayLightning ! Please let me know if you have any questions about making a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants