[PATCH] D25019: [clang-tidy] Make add_new_check.py Python 3 compatible

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 5 22:53:21 PDT 2016


alexfh requested changes to this revision.
alexfh added inline comments.
This revision now requires changes to proceed.


> add_new_check.py:58
> +    f.write(b'//===--- ')
> +    f.write((os.path.basename(filename)).encode())
> +    f.write(b' - clang-tidy')

Too many parentheses.

> add_new_check.py:97-100
> +""" % {b'header_guard': header_guard.encode(),
> +       b'check_name': check_name_camel.encode(),
> +       b'check_name_dashes': check_name_dashes.encode(),
> +       b'module': module.encode()})

Is it better to encode the result of the formatting operator instead?

  (""" ..... """ % {'header_guard': header_guard, ... }).encode()

https://reviews.llvm.org/D25019





More information about the cfe-commits mailing list