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

Removing tabs in .rst, .tex and .pxi files #13146

Closed
roed314 opened this issue Jun 21, 2012 · 26 comments
Closed

Removing tabs in .rst, .tex and .pxi files #13146

roed314 opened this issue Jun 21, 2012 · 26 comments

Comments

@roed314
Copy link
Contributor

roed314 commented Jun 21, 2012

The new doctesting framework (#12415) has revealed tab characters that weren't caught by the old. This ticket changes them to spaces.

Apply attachment: 13146_vs_51b5.patch and attachment: 13146_missed.patch

Component: doctest coverage

Author: David Roe

Reviewer: Keshav Kini, André Apitzsch, Jeroen Demeyer

Merged: sage-5.2.rc0

Issue created by migration from https://trac.sagemath.org/ticket/13146

@kini
Copy link
Contributor

kini commented Jun 21, 2012

comment:2

Needs a real commit message, otherwise looks good :)

@roed314
Copy link
Contributor Author

roed314 commented Jun 21, 2012

Attachment: 13146_vs_51b5.patch.gz

Changes to apply against 5.1.beta5

@roed314

This comment has been minimized.

@roed314
Copy link
Contributor Author

roed314 commented Jun 21, 2012

comment:4

There is now a real commit message.

@kini
Copy link
Contributor

kini commented Jun 21, 2012

comment:5

patchbot: apply 13146_vs_51b5.patch

@kini

This comment has been minimized.

@kini
Copy link
Contributor

kini commented Jun 22, 2012

comment:6

Cool, passes tests.

@kini
Copy link
Contributor

kini commented Jun 22, 2012

Reviewer: Keshav Kini

@roed314
Copy link
Contributor Author

roed314 commented Jun 23, 2012

comment:8

I missed a few that were added between 5.0.beta12 and 5.1.beta5. I wanted to just add them here since it's a small change (though if you like I can make another ticket).

@a-andre
Copy link

a-andre commented Jun 24, 2012

comment:9

Quoting kini:

Needs a real commit message, otherwise [13146_missed.patch] looks good :)

@roed314
Copy link
Contributor Author

roed314 commented Jun 24, 2012

comment:10

Fixed. :)

@a-andre
Copy link

a-andre commented Jun 24, 2012

Changed reviewer from Keshav Kini to Keshav Kini, André Apitzsch

@a-andre
Copy link

a-andre commented Jun 24, 2012

comment:11

You probably added by accident

Index: sage/schemes/elliptic_curves/constructor.py
===================================================================
--- a/sage/schemes/elliptic_curves/constructor.py
+++ b/sage/schemes/elliptic_curves/constructor.py
@@ -1,6 +1,8 @@
 """
 Elliptic curve constructor
 
+sage: EllipticCurve([0,0])
+
 AUTHORS:
 
 - William Stein (2005): Initial version

Please remove this.

@a-andre

This comment has been minimized.

@roed314
Copy link
Contributor Author

roed314 commented Jun 25, 2012

comment:12

Sorry about that. qrefresh -e committed some unintended changes.

@jdemeyer
Copy link

comment:16

With #12415, I still get:

sage -t devel/sage/doc/ru/tutorial/appendix.rst # Tab character found
sage -t devel/sage/doc/de/tutorial/interactive_shell.rst # Tab character found
sage -t devel/sage/doc/de/tutorial/tour_functions.rst # Tab character found
sage -t devel/sage/doc/ru/tutorial/tour_functions.rst # Tab character found

@jhpalmieri
Copy link
Member

comment:17

Can someone explain the point of this ticket? The reason that we avoid tab characters in .py files is that Sphinx can't handle them, so Sphinx doesn't work for processing docstrings for introspection in the notebook. Tabs in these other files don't cause problems, so why worry about removing them? Why bother testing for them in #12415?

@kini
Copy link
Contributor

kini commented Jun 26, 2012

comment:18

Another reason to avoid tab characters in .py files is because they can be confusing to anyone trying to read them with an editor whose tab stops are set to something other than 8 characters, if tabs and spaces are mixed (because indentation levels may appear to differ from what the python interpreter actually judges them to be). The python interpreter has a command line switch -t which issues warnings when such a condition exists, for example.

reStructuredText, like Python code, is indentation-sensitive, and so tabs should be avoided in reStructuredText for the same reason they should be avoided in Python code. The same is true of .pxi files.

Dunno why we're testing for tabs in .tex files, though.

@roed314
Copy link
Contributor Author

roed314 commented Jun 26, 2012

comment:19

The location of the test changed, and it was easier to just test for tabs in all of the files that we doctest rather than special case the test based on file type. I can change it to allow tabs if people like and make this ticket invalid.

@kini
Copy link
Contributor

kini commented Jun 26, 2012

comment:20

Personally I'm all for getting rid of tabs everywhere. Either tabs are used semantically or not, and clearly in Sage they're not.

@jhpalmieri
Copy link
Member

comment:21

Replying to @roed314:

The location of the test changed, and it was easier to just test for tabs in all of the files that we doctest rather than special case the test based on file type.

That makes sense. I certainly don't mind getting rid of tabs, but a concerted effort to remove all of them needs a good reason, and this is as good a reason as any.

@roed314
Copy link
Contributor Author

roed314 commented Jun 28, 2012

Attachment: 13146_missed.patch.gz

Missed a few

@roed314
Copy link
Contributor Author

roed314 commented Jun 28, 2012

comment:22

Alright, I fixed the tabs in the Russian and German documentation.

@jdemeyer
Copy link

Changed reviewer from Keshav Kini, André Apitzsch to Keshav Kini, André Apitzsch, Jeroen Demeyer

@jdemeyer
Copy link

Merged: sage-5.2.rc0

@roed314
Copy link
Contributor Author

roed314 commented Oct 23, 2012

comment:26

By the way, here's a good reason to disallow tabs in .rst files. When scanning a comment block, a tab character counts as one space, meaning that the indentation level can drop enough to end the comment block, even if in a text editor it looks just fine. Debugging this just took me a half hour. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants