[MERGE] Less bazaar coding style regressions.

Martin Pool mbp at canonical.com
Sat Dec 13 01:26:16 GMT 2008


On 13 Dec 2008, Marius Kruger <amanic at gmail.com> wrote:
>     +        bzr_dir = osutils.dirname(osutils.realpath(sys.argv[0]))
> 
>     better as
>     bzr_dir = bzrlib.__path__[0]
> 
> 
> I dont really aggree, since we want the workingtree containing the command
> being executed,
> but I changed it to
> bzr_dir = osutils.dirname(bzrlib.__path__[0])

> +    def test_coding_style(self):
> +        """ Check if bazaar code conforms to some coding style conventions.
> +
> +        Currently we check all .py files for:
> +         * new trailing white space
> +         * new leading tabs
> +         * new long lines (give warning only)
> +         * no newline at end of files
> +        """
> +        bzr_dir = osutils.dirname(bzrlib.__path__[0])
> +        try:
> +            wt = WorkingTree.open(bzr_dir)
> +        except:
> +            raise TestSkipped(
> +                'Could not open bazaar working tree %s'
> +                % bzr_dir)

ps I think you should call TestSource.get_bzrlib_dir, rather than doing
it yourself.

-- 
Martin      <http://launchpad.net/~mbp>



More information about the bazaar mailing list