Replies: 3 comments 1 reply
-
Fully agree, ROS 2 coding style is a great example to follow as many developers do |
Beta Was this translation helpful? Give feedback.
0 replies
-
Nice work! For C++ I should also recommend using -Wall -Werror -pedantic as compilation flags within the CMake. Consider also take an eye on https://github.com/ament/ament_lint/blob/rolling/ament_cmake_lint_cmake/doc/index.rst |
Beta Was this translation helpful? Give feedback.
1 reply
-
Great job 👍 I'm totally onboard. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is the style guide for languages used in RA, RAM, and RI repositories.
Languages: Python, Javascript, C++, CMAKE, HTML, CSS, YAML, XML
This guide is heavily based on the ROS2 (Humble) Coding Style Guide
Python
flake8
,black
pydocstyle
C++
ament_cpplint
andament_uncrustify
CMAKE
Summary
find_package
, notFIND_PACKAGE
).snake_case
identifiers (variables, functions, macros).else()
andend...()
commands.(
‘s.set(PARENT_SCOPE)
to macros._
or a reasonable prefix.ament_lint_cmake
Javascript
react
forjsx
components lintingjson
forJSON
lintingeslint
prettier
Base ESLint Config
HTML/CSS
eslint
,stylelint
prettier
XML
xmllint
/ament_xmllint
YAML
yamllint
yamlfmt
How To Setup Your IDE
Python
VSCode
settings.json
filePyCharm
flake8
(details TBD)Javascript - HTML - CSS
VSCode
Install the prettier vscode extension
Install the eslint vscode extension
add the following
.prettierrc
file to the source code.eslintrc.json
to the source codeCSS
stylelint
needed modules.stylelintrc.json
to your source codeYAML
.prettierrc
file to the projects source codesettings.json
fileXML
VSCode
settings.json
fileC++
VSCode
cpplint
anduncrustify
(Ubuntu)settings.json
filewhich cpplint
to find<your-cpplint-path>
uncrustify.cfg
file to your project if not presentCMAKE
settings.json
Full VSCode Settings
Beta Was this translation helpful? Give feedback.
All reactions