[BUG] NXStyle is not catching brackets starting in the same line
Description / Steps to reproduce the issue
On which OS does this issue occur?
[OS: Linux]
What is the version of your OS?
N/A
NuttX Version
mainline
Issue Architecture
[Arch: all]
Issue Area
[Area: Other]
Host information
No response
Verification
- [x] I have verified before submitting the report.
Locally? CI? Steps to reproduce?
Works for me using checkpatch.sh
Hi @TimJTi this print is from AVR PR: https://github.com/apache/nuttx/pull/16365
also on nau7802 driver:
struct i2c_msg_s readcmd[2] = {
It's FUBAR!!! It even accepts this which has MANY style errors:
static int nau7802_read_reg(FAR nau7802_dev_s *dev, uint8_t addr, void *buf,
uint8_t nbytes)
{
struct i2c_msg_s readcmd[2] = {
{
.frequency = CONFIG_SENSORS_NAU7802_I2C_FREQUENCY,
.addr = dev->addr,
.flags = I2C_M_NOSTOP,
.buffer = &addr,
.length = sizeof(addr),
},
{
.frequency = CONFIG_SENSORS_NAU7802_I2C_FREQUENCY,
.addr = dev->addr,
.flags = I2C_M_READ,
.buffer = buf,
.length = nbytes,
},
};
return I2C_TRANSFER(dev->i2c, readcmd, 2);
}
Tims-MacBook-Air nuttx: ./tools/checkpatch.sh -f drivers/sensors/nau7802.c
Tims-MacBook-Air nuttx:
Guess someone broke it and a bisect is needed on the script?
@TimJTi good question! I think it used to work in the past, because Greg implemented nxstyle to be consistent with the Coding Style guy, but we need to confirm it, for example downloading an old nuttx release and testing nxstyle against this same file.
@TimJTi I downloaded NuttX 9.1 and noticed it also wasn't able to detect the issue, you are right, it is "FUBAR"
alan@dev:/tmp/patacongo-nuttx-e4e4cce69624/tools$ ./nxstyle /tmp/nau7802.c
alan@dev:/tmp/patacongo-nuttx-e4e4cce69624/tools$
It needs to be fixed :-/