ufl team mailing list archive
-
ufl team
-
Mailing list archive
-
Message #02030
Re: Fwd: [Branch ~ufl-core/ufl/main] Rev 1192: Fix indentation bug introduced in last commit.
On 20 September 2011 12:23, Johannes Ring <johannr@xxxxxxxxx> wrote:
> On Tue, Sep 20, 2011 at 12:13 PM, Garth N. Wells <gnw20@xxxxxxxxx> wrote:
>> Related to indentation, I opened some UFL code recently and it had tab
>> characters. This screwed up the indentation, and as presented on my
>> screen made it ambiguous as to what the code should/would do. Is there
>> an easy way to search files for tab characters so we can then remove
>> them?
>
> Something like this should work:
>
> $ sed -i 's/\t/ /g' tab-file.txt
Yes and no. This is not a safe way to do it because tabs may be
intended to be 8 spaces wide, and that is precisely why it is so
dangerous to mix spaces and tabs... I think Python is too liberal when
allowing that. But
sed -i 's/\t/ /g' *.py
bzr diff
allows you to see the extent of the problem. Then I fixed it manually,
just a few lines.
Martin
References