Fully agree with this proposal—it will greatly improve consistency and reduce 
unnecessary review noise.
It might be safer to pin a specific Black version in Spotless to ensure 
consistent formatting.


Hongzhi Gao
[email protected]



        



         原始邮件
         
       
发件人:Haonan Hou <[email protected]&gt;
发件时间:2026年4月13日 09:53
收件人:dev <[email protected]&gt;
主题:[DISCUSS] Add Spotless + Black for Python formatting



       Hi&nbsp;all,

I&nbsp;would&nbsp;like&nbsp;to&nbsp;start&nbsp;a&nbsp;discussion&nbsp;about&nbsp;adding&nbsp;Python&nbsp;formatting&nbsp;
with&nbsp;Spotless&nbsp;+&nbsp;Black&nbsp;in&nbsp;the&nbsp;python&nbsp;module.

Currently,&nbsp;both&nbsp;the&nbsp;Java&nbsp;and&nbsp;C++&nbsp;modules&nbsp;already&nbsp;use&nbsp;Spotless&nbsp;
for&nbsp;code&nbsp;formatting.&nbsp;I&nbsp;think&nbsp;it&nbsp;may&nbsp;make&nbsp;sense&nbsp;to&nbsp;align&nbsp;the&nbsp;Python
&nbsp;module&nbsp;with&nbsp;the&nbsp;same&nbsp;workflow.

The&nbsp;current&nbsp;proposal&nbsp;is&nbsp;to&nbsp;use&nbsp;spotless-maven-plugin&nbsp;in&nbsp;
python/pom.xml,&nbsp;use&nbsp;black&nbsp;to&nbsp;format&nbsp;regular&nbsp;Python&nbsp;files&nbsp;(*.py),&nbsp;
and&nbsp;exclude&nbsp;Cython-related&nbsp;files&nbsp;such&nbsp;as&nbsp;*.pyx&nbsp;and&nbsp;*.pxd&nbsp;for&nbsp;now,&nbsp;
since&nbsp;Black&nbsp;does&nbsp;not&nbsp;handle&nbsp;Cython&nbsp;syntax&nbsp;well.

This&nbsp;should&nbsp;help&nbsp;keep&nbsp;Python&nbsp;code&nbsp;style&nbsp;consistent&nbsp;and&nbsp;reduce&nbsp;
formatting-related&nbsp;review&nbsp;noise.

I&nbsp;have&nbsp;opened&nbsp;a&nbsp;PR&nbsp;for&nbsp;this&nbsp;here:
https://github.com/apache/tsfile/pull/770

Any&nbsp;thoughts&nbsp;on&nbsp;whether&nbsp;we&nbsp;should&nbsp;adopt&nbsp;this?

Best,
Haonan&nbsp;Hou

Reply via email to