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

printer: ensure compatibility with asmfmt #8

Open
mmcloughlin opened this Issue Dec 29, 2018 · 3 comments

Comments

1 participant
@mmcloughlin
Copy link
Owner

mmcloughlin commented Dec 29, 2018

klauspost/asmfmt is the de facto standard for Go assembly formatting. It would be good to produce output that conforms to asmfmt.

I have a preference for avoiding non-Go dependencies (stdlib and sub-repos only). Therefore:

  • If it is possible to produce conforming output without actually depending on asmfmt explicitly, that would be preferred. This may actually be possible since (at the time of writing) many of the asmfmt rules simply wouldn't apply to avo output.
  • If the rules enforced by asmfmt are too complicated, then we can accept the additional dependency.

Either way, it would be good to have a check in CI to confirm that all generated files are formatted correctly. Something like find . -name '*.s' | xargs asmfmt -w and check the git repo is clean.

mmcloughlin added a commit that referenced this issue Jan 11, 2019

mmcloughlin added a commit that referenced this issue Jan 11, 2019

lint: ensure conformity with asmfmt
Run asmfmt suring linting and confirm git repository isn't dirty.
This introduces a developer tools dependency on asmfmt, but not a
runtime dependency.

Updates #8

mmcloughlin added a commit that referenced this issue Jan 11, 2019

@mmcloughlin

This comment has been minimized.

Copy link
Owner

mmcloughlin commented Jan 11, 2019

Fixed by 27cea3b

mmcloughlin added a commit that referenced this issue Jan 11, 2019

@mmcloughlin

This comment has been minimized.

Copy link
Owner

mmcloughlin commented Jan 11, 2019

Based on 3ca82be I think we have a mismatch with comments ahead of labels. But there seems to be a special case when there is a comment above and below a label? Needs investigation.

@mmcloughlin mmcloughlin reopened this Jan 11, 2019

@mmcloughlin

This comment has been minimized.

Copy link
Owner

mmcloughlin commented Jan 11, 2019

I think asmfmt sets indentation to 0 after terminal instructions. I'm not quite sure this is correct behavior. Filed klauspost/asmfmt#35 to discuss.

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