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
maxim-belkin opened this issue Apr 13, 2018 · 17 comments
Open

Long lines in lessons #498

maxim-belkin opened this issue Apr 13, 2018 · 17 comments

Comments

@maxim-belkin
Copy link
Contributor

@maxim-belkin 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 added 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

@ncgoodbody ncgoodbody commented May 2, 2018

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

@ncgoodbody ncgoodbody commented May 2, 2018

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

@maxim-belkin maxim-belkin commented May 2, 2018

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

@ncgoodbody ncgoodbody commented May 2, 2018

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

@maxim-belkin maxim-belkin commented May 2, 2018

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

@ncgoodbody ncgoodbody commented May 2, 2018

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 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

@mike-allaway mike-allaway commented May 23, 2018

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

@maxim-belkin maxim-belkin commented May 23, 2018

Thank you for the reminder, @MikeAllawayBham!

katkoler added a commit to katkoler/python-novice-inflammation that referenced this issue Oct 12, 2018
@katkoler
Copy link
Contributor

@katkoler katkoler commented Oct 12, 2018

Hi, I'd like to help with this.
Is there a good way of testing it renders correctly?

@maxim-belkin
Copy link
Contributor Author

@maxim-belkin maxim-belkin commented Oct 12, 2018

Hi, @katkoler. If you've got macOS or Linux, make serve (or jekyll serve or bundle exec jekyll serve) will render the site for you and you will be able to check it out at http://127.0.0.1:4000.
If you're on a Windows machine make docker-serve.

@katkoler
Copy link
Contributor

@katkoler katkoler commented Oct 12, 2018

@maxim-belkin thanks! I'll just check that everything looks okay and open a pull request.

@SRSteinkamp
Copy link
Contributor

@SRSteinkamp SRSteinkamp commented Jan 19, 2021

Is there still any help needed?

@ldko
Copy link
Contributor

@ldko 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

@SRSteinkamp SRSteinkamp commented Jan 20, 2021

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!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Codename "Py"
  
In progress
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
9 participants