You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I break within a function, then tango needs to add it's comments inline within the function. rustfmt indents these lines, but as I'm not checking in the *.rs files, this formatting correction is not seen by CI checks. In CI, I do a build in order to tangle the files and then run rustfmt check to verify that the source is formatted properly.
Example:
fnmain(){//@ In the main fn}
Wont pass the rustfmt check.
Options
Change tango to indent the comments in these cases. I don't know how complicated this is, I'd imagine getting it to work for most cases would not be so hard, but getting it to work in the general case would be complicated as it'd require implementing rustfmts rules.
Ignore fmt in CI, either the tangled files or this specific indentation rule. I'm not sure how specific I could be about ignoring, but I'm sure I can't just ignore the cases with tango comments without ignoring the format of other comments
Check in the *.rs files as well as the *.md files (and the tango.stamp file) - this seems like the simplest option, but I'm not sure what the implication is, as it is recommended not to do this in the tango-demo
The text was updated successfully, but these errors were encountered:
Thanks for the bug report. You're discovering that I'm one of those bad programmers who doesn't apply rustfmt to their pet projects.
I'll see what I can do about this.
(The main problem I can recall about checking in the *.rs files along with the *.md files is that when you pull out the files, the local file system will assign timestamps based on those files being created locally. Though if the two files are actually consistent, this wouldn't be a problem, except that I think I currently bail out eagerly if the target file has a newer timestamp of any kind, rather than optimistically attempting the transformation and then seeing if the result matches up, see also issue #17 which seems related...)
What you can do is check in your *.rs files instead of your *.md files. That use case is supposed to be supported; i.e., you're supposed to be able to choose, for each file, whether its master copy belong as markdown or as rust source.
If I break within a function, then tango needs to add it's comments inline within the function. rustfmt indents these lines, but as I'm not checking in the *.rs files, this formatting correction is not seen by CI checks. In CI, I do a build in order to tangle the files and then run
rustfmt check
to verify that the source is formatted properly.Example:
Wont pass the rustfmt check.
Options
The text was updated successfully, but these errors were encountered: