AlexsLemonade / refinebio-examples

Example workflows for refine.bio data

Home Page:https://www.refine.bio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enforce code width limit

jashapiro opened this issue · comments

Background/Problem

Related to #289

Occasionally we have lines of code that get a bit long and don't render well in the html versions of notebooks.
A normal code width limit of ~80-100 characters for a bare notebook is probably too generous at times for html display, especially if users try to narrow their windows.

This seems to occur in our code most often in comments (perhaps because these are not affected by styling), especially when trailing comments occur on a line.

What potential "gotchas" do we know of?

I don't think this is something styler can handle automatically, but if it can, that might be the ideal case. I can't find a line-width argument in its options, though it may be buried somewhere.

formatR was an alternative I looked at that does handle this somewhat, but it seems to not play well with pipes, and is otherwise aggressive.

What are the recommended next steps?

I am compiling a list of wide lines (>70 characters, as tha tis what I used for output in #402) based on the current staging branch, but maintaining this standard in the future will require vigilance, and it should be added to CONTRIBUTING.md at a minimum.

Automated checking would be a nice feature if we can figure out a method.

I am going to add to this issue with separate comments for each file.

Is there a particular timeframe for this issue?

Before going live

Deleted most comments, because they were way too much here. Plan of attack is to check this as we go through #289 and #290. I will soon file a PR with some changes in 02-microarray/clustering_microarray_01_heatmap.Rmd

I am also thinking that 80 characters is probably a sufficient limit here for most cases, based at least on how things look for me with reasonable window widths most of the time (I like smaller for the output though). I think we should strive to be shorter, but if only comments are getting up toward that limit, we should be fine.