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

Formatting settings? #209

Closed
RobertBaruch opened this issue Sep 15, 2019 · 10 comments
Closed

Formatting settings? #209

RobertBaruch opened this issue Sep 15, 2019 · 10 comments
Labels

Comments

@RobertBaruch
Copy link

RobertBaruch commented Sep 15, 2019

Does the project use yapf, autopep8, or black for standard auto-formatting? Any special parameters passed to these?

@whitequark
Copy link
Contributor

whitequark commented Sep 15, 2019

I don't usually use autoformatters, most of them are downright terrible. clang-format is okay but this isn't a C project.

@cr1901
Copy link
Contributor

cr1901 commented Sep 15, 2019

@whitequark Thoughts on adding a flake8 step to Travis that checks immediately whether the code is properly formatted (based on the rules you decide- i.e. remove the restrictive 80 char per line limit), and fails if it's not?

@whitequark
Copy link
Contributor

I'm not sure if there's much point to it.

@RobertBaruch
Copy link
Author

I prefer to leave formatting up to the auto-formatter so that I don't have to do any formatting myself. Specifying the project policy as no auto-formatting, though, is perfectly fine. I'll just have to remember to turn the auto-formatter off when I write code for nMigen :)

@whitequark
Copy link
Contributor

Yeah, I would prefer no autoformatting for now. Could perhaps be changed in the future.

@whitequark
Copy link
Contributor

Somewhat annoyingly, nmigen-boards would benefit from autoformatting, but any Python autoformatter I know of would mess up the board definitions badly.

@RobertBaruch
Copy link
Author

That's what # yapf: disable and # yapf: enable are for :)

@whitequark
Copy link
Contributor

What's the point of using yapf if you disable it on 99% of code?

@RobertBaruch
Copy link
Author

The board files aren't 99% of the code, are they?

@whitequark
Copy link
Contributor

They are 99% of code in nmigen-boards (which is a different repository with different tooling settings).

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

No branches or pull requests

3 participants