apisix icon indicating copy to clipboard operation
apisix copied to clipboard

CI: line is too line

Open starsz opened this issue 6 years ago • 5 comments

Hi, while I am reading the code, I found that some lines are too long (More than eighty characters).

As the CODE_STYLE.md said.

Each line cannot exceed 80 characters. If it exceeds, you need to wrap and align:

I recommend adding --max-line-length 80 into luacheck, and fix all the lines exceed 80 characters.

starsz avatar Oct 30 '20 02:10 starsz

I agree that 80 characters are enough most of the time, but sometimes 80 characters seem a little bit short and make the code more awkward to read, just for python.

idbeta avatar Oct 30 '20 03:10 idbeta

The specification of 80 characters forces programmer to design concise variable name, function name and literals, I don't think it makes the code more awkward to read (if so, community can refactor it :) ), so i think we should obey the code style specification.

tokers avatar Oct 30 '20 03:10 tokers

@starsz Currently we already have the line length style check in lj-releng. The length we chose is 100.

spacewander avatar Oct 30 '20 03:10 spacewander

Okay, I follow the decision of the community. Hmmm.

starsz avatar Oct 30 '20 03:10 starsz

The length we chose is 100.

I think 100 is fine.

https://github.com/apache/apisix/blob/master/.luacheckrc#L4

we checked it by luacheck too.

membphis avatar Oct 30 '20 08:10 membphis