RPVote / eiCompare

Comparing ecological inference techniques
https://rpvote.github.io/voting-rights/
6 stars 7 forks source link

Discussion: code style and formatting rules #5

Closed scottyhq closed 4 years ago

scottyhq commented 4 years ago

As folks start working on various aspects of this codebase, it's a good time to start enforcing a coding style. Will also help enforce best-practices and consistency (such as 'F' and 'T' versus 'False' and 'True' -- https://github.com/DSSG-eiCompare/eiCompare/issues/4)

This seems like a nice solution for automatic styling https://github.com/r-lib/styler. It's possible to set this up via continuous integration (see https://github.com/DSSG-eiCompare/eiCompare/pull/3), so that your code is re-styled when committed.

@lorenc5 @pssachdeva @woodsp @jcburke @hikari-murayama @aridf @jmhernan @gabrieleliasmartinez - any preferences on configuration options? Would you prefer using a different tool for this?

hikari-murayama commented 4 years ago

I'm onboard with using styler!

aridf commented 4 years ago

Yeah styler sounds great to me!

lorenc5 commented 4 years ago

Agreed, that looks exciting!!

On Fri, Jul 10, 2020 at 11:18 AM Ari Decter-Frain notifications@github.com wrote:

Yeah styler sounds great to me!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DSSG-eiCompare/eiCompare/issues/5#issuecomment-656789272, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGKPEZW34PJDSGI47PYKBODR25EPTANCNFSM4OWEJ2DA .

-- Loren Collingwood Associate Professor Department of Political Science University of California, Riverside collingwoodresearch.com

pssachdeva commented 4 years ago

styler sounds good. In terms of configuration: we could start out with "tokens" for scope and see how consistent it is. I also can't tell off a cursory glance if it sets a character limit for lines, but in terms of general style, I'm partial to 100 characters.

scottyhq commented 4 years ago

styler sounds good. In terms of configuration: we could start out with "tokens" for scope and see how consistent it is. I also can't tell off a cursory glance if it sets a character limit for lines, but in terms of general style, I'm partial to 100 characters

I just made a PR using the styler defaults, it's instructive to take a look at what changes this results in (https://github.com/DSSG-eiCompare/eiCompare/pull/8/files)

Line limits aren't enforced. Seems like the suggestion is to run lintr::lint_package() which complains if lines are>80chars