On Jul 19, 2009, at 1:06 AM, Pat LeSmithe wrote: > The patch at > > http://trac.sagemath.org/sage_trac/ticket/5653 > > renders docstrings and source code from the Sage library in the > notebook > using Sphinx. Tab characters can confuse Sphinx (see comment 11), so > apart from other reasons, it would be useful to keep stray tabs out of > the .py and .pyx files in the Sage library. An earlier ticket > > http://trac.sagemath.org/sage_trac/ticket/5848 > > took care of this, but it seems that new tabs have appeared: > > tcsh> cd $SAGE_ROOT/devel/sage/sage > tcsh> grep "`echo '\t'`" `find -name \*.pyx -o -name \*.py` > [...] > > Of course, we can untabify the files periodically. Is there a > better way? > > I think we can use Mercurial's hooks > > http://hgbook.red-bean.com/read/handling-repository-events-with- > hooks.html > > to check for and complain about tabs before a commit, but I'm not an > expert. How about hooks for other tasks, e.g., for finding > > * Unused imports. > * ReST mistakes. > * Missing doctests. > > ?
Another complementary (and perhaps easier) way would be to add something to the sage -merge script to address the above issues. (Tabs seem particularly easy to spot.) If the false-positive rate is low enough, it would be good to have a build bot that automatically downloads everything needing a review, makes sure it applies, runs the above "lint" tests, and posts the results to trac. - Robert --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---