[RFC PATCH v1 1/1] devtools: add vscode configuration generator

Burakov, Anatoly anatoly.burakov at intel.com
Fri Jul 26 18:05:08 CEST 2024


On 7/26/2024 5:36 PM, Stephen Hemminger wrote:
> On Fri, 26 Jul 2024 13:42:56 +0100
> Anatoly Burakov <anatoly.burakov at intel.com> wrote:
> 
>> A lot of developers use Visual Studio Code as their primary IDE. This
>> script generates a configuration file for VSCode that sets up basic build
>> tasks, launch tasks, as well as C/C++ code analysis settings that will
>> take into account compile_commands.json that is automatically generated
>> by meson.
>>
>> Files generated by script:
>>   - .vscode/settings.json: stores variables needed by other files
>>   - .vscode/tasks.json: defines build tasks
>>   - .vscode/launch.json: defines launch tasks
>>   - .vscode/c_cpp_properties.json: defines code analysis settings
>>
>> The script uses a combination of globbing and meson file parsing to
>> discover available apps, examples, and drivers, and generates a
>> project-wide settings file, so that the user can later switch between
>> debug/release/etc. configurations while keeping their desired apps,
>> examples, and drivers, built by meson, and ensuring launch configurations
>> still work correctly whatever the configuration selected.
>>
>> This script uses whiptail as TUI, which is expected to be universally
>> available as it is shipped by default on most major distributions.
>> However, the script is also designed to be scriptable and can be run
>> without user interaction, and have its configuration supplied from
>> command-line arguments.
>>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov at intel.com>
> 
> The TUI doesn't matter much since I would expect this gets run
> 100% on Windows.

I run it on Linux using Remote SSH, and that's the primary target 
audience as far as I'm concerned (a lot of people do the same at our 
office). Just in case it wasn't clear, this is not for *Visual Studio* 
the Windows IDE, this is for *Visual Studio Code* the cross-platform 
code editor.

I didn't actually think of testing this on Windows. I assume Windows 
doesn't have whiptail, so this will most likely refuse to run in TUI 
mode (unless run under WSL - I assume WSL ships whiptail).

> 
> In general looks good, you might want to address
> $ flake8 ./devtools/gen-vscode-config.py  --max-line 100
> ./devtools/gen-vscode-config.py:352:47: E741 ambiguous variable name 'l'
> ./devtools/gen-vscode-config.py:499:16: E713 test for membership should be 'not in'
> ./devtools/gen-vscode-config.py:546:101: E501 line too long (120 > 100 characters)

Thanks, I had Pylance linter but not flake8.

-- 
Thanks,
Anatoly



More information about the dev mailing list