spacewander commented on PR #8651:
URL: https://github.com/apache/apisix/pull/8651#issuecomment-1409641123

   > > [#8651 
(comment)](https://github.com/apache/apisix/pull/8651#discussion_r1073064191) 
It seems there are still indentation issues. Some places use 8-spaces 
indentation instead of 4.
   > 
   > I checked the code and `make lint` cant get WARN and ERROR, could you give 
some hint about this? I break a long code line to multiple lines, it will be 
made like follow by default:
   > 
   > ```lua
   > log.error("connect consul: ", consul_server.consul_server_url,
   >         ", by service url: ", svc_url, ", with error: ", error_info)
   > ```
   
   The style guide tells us that we need to use 4-spaces indentation: 
https://github.com/apache/apisix/blob/master/CODE_STYLE.md#indentation
   
   Some of the newly added code use 8-spaces indentation.
   
   Another acceptable indentation is aligning the '(', like:
   ```
   log.error("connect consul: ", consul_server.consul_server_url,
             ", by service url: ", svc_url, ", with error: ", error_info)
   ```
   
   It is widely used in the APISIX source code.
   
   I have tried several lints/fmtters. Unfortunately, they can't handle the 
second case. Therefore, so far we don't have an automatical mechanism to detect 
the indentation issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to