Closed k8hertweck closed 3 years ago
PEP8 standards include an expectation for an empty line: "W292 | no newline at end of file". Clearly this doesn't prevent the code from functioning as expected, though. I know our python code has been run through a linter; is there a reason why we haven't included empty lines?
I'm inclined to add a pop-out to the advanced shell chapter that suggests empty lines at the end of shell scripts, since using cat
to print scripts without them makes them look crappy:
bash-3.2$ cat book_summary.sh
# Get author information from a Project Gutenberg eBook.
# Usage: bash book_summary.sh /path/to/file.txt what_to_look_for
head -n 17 $1 | tail -n 8 | grep $2bash-3.2$
I'll need to know how to proceed before I continue developing Amira's repo.
I think we should definitely include a newline at the end of all our bash scripts, python scripts and makefiles. For some reason pycodestyle
didn't pick up that problem when I ran it on the python scripts in zipf/bin
, but it should have.
A pop-out in the advanced shell chapter would work - for python scripts it might also be worth mentioning it in the "writing readable code" appendix.
Great, I’ll include these items in #554 . Thanks for the confirmation!
Nothing in
bin/
in the Zipf's Law project directory currently includes a newline at the end of the file, thoughrequirements.txt
and files inresults/
do. Do we need to include a callout about this, especially since some text editors and git interfaces yell at users about it?