Comments (4)
Hi @jpconstantineau.
I am running the linter using your github-action (thanks for making it available)
You're welcome. I'm glad if you find it useful.
Are the identifiers too long? Are they too short? Is it a rule parsing problem? is it a problem with the rule or my file?
The problem is here:
https://github.com/jpconstantineau/Community_nRF52_Arduino/blob/4dacbfabb170843c275c4afaac6f8e2c08d1b319/boards.txt#L361
=======
boards.txt uses a "key=value" format. Apparently zero length keys are supported by the format. So what this line does is create a board ID that has zero length. This board is missing the required properties. So this is the reason why the error/warning messages only show an empty space where you would expect the board ID to be.
The fix would be to either remove line 361 from your boards.txt or else change it to a comment by prefixing it with #
.
This is certainly a confusing error to troubleshoot (though likely a rare occurrence). I guess the experience would be improved by adding a "zero-length board ID" rule to Arduino Lint.
from arduino-lint.
Thank you. This fixed my issue with my boards.txt file. I had the offending line in 2 locations.
Indeed, a new rule for zero-length board ID would be useful. I really don't know why I had this type of separator when everything else was commented. I assume there is a rule to find non-commented, non-"key-value" formatted lines but this specific line would not have triggered it.
I am not sure if the linting framework allows for giving line numbers but that would be useful too.
I won't close the issue as you may want to link a new rule PR to this issue. I'll let you decide. Thanks
from arduino-lint.
I assume there is a rule to find non-commented, non-"key-value" formatted lines but this specific line would not have triggered it.
Yes, PF002 check for invalid data format. It's just that your problematic lines happened to have a completely valid data format as far as the Arduino "properties" data format is concerned. In the case of invalid data format, the error message is much more helpful:
Rule PF002 result: fail
ERROR: boards.txt has an invalid format: Error reading file: Error parsing data at line 42: Invalid line format, should be 'key=value'
I am not sure if the linting framework allows for giving line numbers but that would be useful too.
The problem is that the configuration files are parsed into a data map (as shown below) before being validated, so the identification of the JSON schema violation is a somewhat cryptic JSON pointer to the path in that data structure. So it would be necessary to backtrack from that pointer to the location in the source file. And of course in the case of rules about required or recommended properties, such as the ones mentioned in this issue, a line number is not applicable.
{
"4x4macropad_nrf52832": {
"bootloader.tool": "bootburn",
"build.board": "4X4MACROPAD_NRF52832",
"build.core": "nRF5",
"build.extra_flags": "-DNRF52832_XXAA -DNRF52",
"build.f_cpu": "64000000",
"build.ldscript": "nrf52832_s132_v6.ld",
"build.mcu": "cortex-m4",
"build.usb_manufacturer": "\"BlueMicro\"",
"build.usb_product": "\"4x4 Macropad nRF52832\"",
"build.variant": "4x4macropad_nrf52832",
"menu": {
"debug": {
"l0": {
"build.debug_flags": "-DCFG_DEBUG=0"
},
"l1": {
"build.debug_flags": "-DCFG_DEBUG=1"
},
"l2": {
"build.debug_flags": "-DCFG_DEBUG=2"
},
"l3": {
"build.debug_flags": "-DCFG_DEBUG=3",
"build.sysview_flags": "-DCFG_SYSVIEW=1"
}
},
"softdevice": {
"s132v6": {
"build.bl_version": "0.4.0",
"build.sd_fwid": "0x00B7",
"build.sd_name": "s132",
"build.sd_version": "6.1.1"
}
}
},
"name": "4x4 Macropad (nRF52832)",
"upload.maximum_data_size": "52224",
"upload.maximum_size": "290816",
"upload.native_usb": "false",
"upload.protocol": "nrfutil",
"upload.tool": "nrfutil",
"upload.use_1200bps_touch": "false",
"upload.wait_for_upload_port": "false"
},
... and so on
from arduino-lint.
The file being parsed and converted into a json file/object indeed wouldn't be able to keep the line number of the original file.
This clarifies things a lot. Thanks
from arduino-lint.
Related Issues (20)
- Please add check for invalid examples e.g. containing no ino file HOT 3
- Question: Why are library names limited to 16 characters? (low prio) HOT 2
- Add maximum file system size rule for libraries
- Add the ability to mute some rules HOT 1
- Broken link in docs HOT 1
- Strict check on libraries should check for header guards or #pragma once HOT 2
- Consider raising LP048 to error instead of warning HOT 2
- Feature Request: Add ability to exclude certain sub-folders from checks
- Feature request: Support macOS arm64 HOT 5
- Update link LP018 HOT 1
- arduino-lint can't load url from library.properties (http status 503) HOT 3
- New error raised with 1.2.1 while it should not
- My `examples` directory is getting ignored HOT 1
- Change of LP010: Increase character limit for naming Arduino libraries
- Publish Arduino project JSON schemas to "JSON Schema Store"
- Allow test sketches to be outside examples folder HOT 1
- Documentation and linter setup mismatch HOT 1
- Specify link to Github, BitBucket or GitLab as requirement for `url` field HOT 1
- Broken symlinks in libraries results in linter panic HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino-lint.