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

Long lines in lessons #498

Open
9 of 10 tasks
maxim-belkin opened this issue Apr 13, 2018 · 21 comments
Open
9 of 10 tasks

Long lines in lessons #498

maxim-belkin opened this issue Apr 13, 2018 · 21 comments
Labels
good first issue Good issue for first-time contributors help wanted Looking for Contributors status:in progress Contributor working on issue
Milestone

Comments

@maxim-belkin
Copy link
Contributor

maxim-belkin commented Apr 13, 2018

We need to shorten the following long lines in lessons (based on make lesson-check-all).
Please feel free to submit PRs (please change one file per PR) and reference this issue (use #498).

$ make lesson-check-all
/CONTRIBUTING.md: Line(s) too long: 3, 114, 126 (Out of scope: has to be fixed in carpentries/style)

  • ./README.md: Line(s) too long: 2, 4, 5, 7, 8, 9, 10, 13, 30
  • ./_episodes/01-intro.md: Line(s) too long: 160, 175
  • ./_episodes/02-numpy.md: Line(s) too long: 69, 71, 80, 91, 95, 96, 98, 99, 100, 101, 102, 278, 441, 578
  • ./_episodes/03-matplotlib.md: Line(s) too long: 33, 44
  • ./_episodes/04-loop.md: Line(s) too long: 373
  • ./_episodes/05-lists.md: Line(s) too long: 23, 120, 273, 291
  • ./_episodes/07-cond.md: Line(s) too long: 103
  • ./_episodes/09-errors.md: Line(s) too long: 498
  • ./_episodes/11-debugging.md: Line(s) too long: 68
  • ./setup.md: Line(s) too long: 47, 50, 55, 57, 102

Updated: January 20, 2021

@maxim-belkin maxim-belkin added this to In progress in Codename "Py" Apr 13, 2018
maxim-belkin pushed a commit that referenced this issue May 1, 2018
Fix long lines 36 and 46 reported by 'make lesson-check-all'

See #498
Closes #515

Signed-off-by: Maxim Belkin <maxim.belkin@gmail.com>
KerensaMcElroy added a commit to KerensaMcElroy/python-novice-inflammation that referenced this issue May 2, 2018
Shorten lines 8 and 24.

See swcarpentry#498
@ncgoodbody
Copy link
Contributor

Just for my own learning, why is it important to limit the lines to 100 characters? Is it about readability of the code? Are there other formatting conventions I should keep in mind?

@ncgoodbody
Copy link
Contributor

Also, please ignore #519. I forgot to delete my old fork before I started work on the new file.

@maxim-belkin
Copy link
Contributor Author

Just for my own learning, why is it important to limit the lines to 100 characters?

git tracks changes on a line-by-line basis, so if you change a single character in a 5000 character-long paragraph written as a single line, it will highlight the entire line. Moreover, it will show it twice (original and changed version). And single line breaks are not a problem for Markdown... so, there is really no benefit in using long lines as shorter ones make life much easier.

Why exactly 100? This number is more-or-less arbitrary. People usually choose the number of characters that fit in their text editor without wrapping to the next (virtual) line. "100" is hard-coded into lesson-check and, honestly, I don't care about its exact value as long as it is reasonable: not too small, not too large... it could be 78, 83, 94, etc.

Also, please ignore #519. I forgot to delete my old fork before I started work on the new file.

Um... ok, but we need to talk :) You should use branches for pull requests:

git checkout -f gh-pages
git pull origin gh-pages

git branch mybranch
git checkout mybranch
# make changes
git add -u
git commit
git push <your-fork>

git checkout gh-pages
# submit pull-request on GitHub

@ncgoodbody
Copy link
Contributor

Thanks for the explanation @maxim-belkin!

Don't I need permission to access this repository in order to make branches? I'm working from the GitHub desktop client, so do I need to work in git directly?

@maxim-belkin
Copy link
Contributor Author

Um, to create branches in this repository one has to have proper permissions, but you don't need these.
The way it works is as follows:

  1. you fork this repository. Your fork will be here https://github.com/doctornerdis/python-novice-inflammation
  2. You clone your fork to your computer git clone https://github.com/doctornerdis/python-novice-inflammation
  3. You create a new branch for your changes: git checkout -b my-changes
  4. You make changes to files, then git add -u, git commit
  5. You push your branch to your fork git push
  6. You submit a PR on GitHub using this branch

To keep your fork up-to-date, you do:

git checkout gh-pages
git add swcarpentry https://github.com/swcarpentry/python-novice-inflammation  ## only once per repository
git fetch swcarpentry
git merge --ff-only
git push

Oh, and I now see that you've already deleted your fork that you used to submit #520. There is a better way! :)

@ncgoodbody
Copy link
Contributor

OK, I think I'm getting the hang of it now. I just did another PR (#521). Is that the right workflow?

@maxim-belkin
Copy link
Contributor Author

maxim-belkin commented May 2, 2018

Yep! Just don't forget to switch back to gh-pages before creating a branch for your next PR

git checkout gh-pages
git pull swcarpentry ## just in case
git checkout -b my-next-pr

@mike-allaway
Copy link
Contributor

Hi @maxim-belkin , may be worth ticking off the lessons that have been done from the issue description at the top of this page, to make it clearer to newcomers which are left to do

@maxim-belkin
Copy link
Contributor Author

Thank you for the reminder, @MikeAllawayBham!

@fmichonneau fmichonneau added help wanted Looking for Contributors good first issue Good issue for first-time contributors status:in progress Contributor working on issue and removed help-wanted labels Jun 8, 2018
@SRSteinkamp
Copy link
Contributor

Is there still any help needed?

@ldko
Copy link
Contributor

ldko commented Jan 20, 2021

Hi Simon,
Thank you for inquiring. I have updated the description with the output of running the command $ make lesson-check-all which shows that we have lines that needed shortening. If you would like to work on this issue, please edit one file per PR. Thanks!

@SRSteinkamp
Copy link
Contributor

Thank you Idko for putting me into the loop :)

I will work on the other files in the coming days, that's it for today :) ... also if you have any comments on how to improve my PRs, I am happy to adjust them (especially in the future!)

@vinisalazar
Copy link
Collaborator

Hi!

I just ran the make lesson-check-all command and got the following output:

./CONTRIBUTING.md: Line(s) too long: 3, 114, 126
./README.md: Line(s) too long: 2, 4, 5, 7, 8, 9, 10, 13
./_episodes/03-matplotlib.md: Line(s) too long: 133

I will submit PRs to try to fix the remaining warnings.

Best,

V

@ldko
Copy link
Contributor

ldko commented Mar 22, 2021

Hi @vinisalazar , thanks for the offer! I believe the changes in CONTRIBUTING.md would need to be done outside of this lesson, specifically in the carpentries/style repo. The README.md lines that are too long are due to the markdown formatting for the table on the page, and I don't know of a way to get them under the 100 character mark and retain the formatting (if you do, please submit a fix :) ). Getting a PR from you for the 03-matlotlib.md file would be great!

@vinisalazar
Copy link
Collaborator

Hi @ldko ! Thank you for the fast reply.

Good observation. I'll have a look at the template repos to see if I can contribute something there.

Best,

V

@vinisalazar
Copy link
Collaborator

carpentries/lesson-example#330 addresses the CONTRIBUTING.md and README.md files.

zkamvar pushed a commit that referenced this issue Apr 21, 2023
Fix long lines 36 and 46 reported by 'make lesson-check-all'

See #498
Closes #515

Signed-off-by: Maxim Belkin <maxim.belkin@gmail.com>
zkamvar pushed a commit that referenced this issue Apr 21, 2023
Fixes lines 13, 15, 19

Pull Request: #565
Related Issue: #498
zkamvar pushed a commit that referenced this issue Apr 21, 2023
 - Fixes (long) lines: 176
 - Changes "in place" to "in-place" as in  `Be careful when modifying data in-place`
 - Define new link "hadleywickham-tweet" (DRY)

Pull Request: #566
Related Issue: #498
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good issue for first-time contributors help wanted Looking for Contributors status:in progress Contributor working on issue
Projects
No open projects
Codename "Py"
  
In progress
Development

No branches or pull requests

10 participants