diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ee9d543 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,39 @@ +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +trim_trailing_whitespace = true + +[*.{cpp,cppm,hpp,h,c}] +indent_style = space +indent_size = 2 +max_line_length = 80 + +[*.py] +indent_style = space +indent_size = 4 +max_line_length = 80 + +[*.{yml,yaml}] +indent_style = space +indent_size = 2 + +[CMakeLists.txt] +indent_style = space +indent_size = 4 +max_line_length = 80 + +[*.cmake] +indent_style = space +indent_size = 4 +max_line_length = 80 + +[*.md] +trim_trailing_whitespace = false +max_line_length = 80 + +[*.json] +indent_style = space +indent_size = 2 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..aecbe84 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,21 @@ +## Summary + + + +## Related Issue + + + +## Changes + + + +- + +## Test Plan + + + +- [ ] All CI checks pass +- [ ] New/updated tests cover the changes +- [ ] Tested locally with `conan create .` diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..a57947b --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,85 @@ +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +This Code of Conduct also applies outside the project spaces when the Project +Steward has a reasonable belief that an individual's behavior may have a +negative impact on the project or its community. + +## Conflict Resolution + +We do not believe that all conflict is bad; healthy debate and disagreement +often yield positive results. However, it is never okay to be disrespectful or +to engage in behavior that violates the project’s code of conduct. + +If you see someone violating the code of conduct, you are encouraged to address +the behavior directly with those involved. Many issues can be resolved quickly +and easily, and this gives people more control over the outcome of their +dispute. If you are unable to resolve the matter for any reason, or if the +behavior is threatening or harassing, report it. We are dedicated to providing +an environment where participants feel welcome and safe. + +We will investigate every complaint, but you may not receive a direct response. +We will use our discretion in determining when and how to follow up on reported +incidents, which may range from not taking action to permanent expulsion from +the project and project-sponsored spaces. We will notify the accused of the +report and provide them an opportunity to discuss it before any action is taken. +The identity of the reporter will be omitted from the details of the report +supplied to the accused. In potentially harmful situations, such as ongoing +harassment or threats to anyone's safety, we may take action without notice. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, version 1.4, +available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..561ff1b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,28 @@ +# How to Contribute + +We would love to accept your patches and contributions to this project. + +## Contribution process + +### :raised_hand: Self Assigning to an Issue + +If you find an issue you'd like to work on, simply type and submit a comment +with the phrase `.take` in it to get assigned by our github actions. + +### :pencil2: Pull Request Guidelines + +1. Code must finish continuous integration steps before it will be reviewed. +2. Commit messages should follow these guidelines here + https://cbea.ms/git-commit/. +3. Pull requests should contain a single commit +4. Pull requests should be small and implement a single feature where possible. + If it can be broken up into separate parts it most likely should be. +5. Each PR should have an associated issue with it. Exceptions are made for very + small PRs such as fixing typos, fixing up documentation or removing + unnecessary headers. + +### Code Reviews + +All submissions, including submissions by project members, require review. We +use [GitHub pull requests](https://docs.github.com/articles/about-pull-requests) +for this purpose. diff --git a/conanfile.py b/conanfile.py index 6d5b412..0c5ef0f 100644 --- a/conanfile.py +++ b/conanfile.py @@ -19,6 +19,7 @@ from conan.tools.files import copy from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd +from conan.tools.scm import Version from pathlib import Path @@ -82,7 +83,7 @@ def _validate_compiler_version(self): f"Compiler {compiler} is not supported for C++20 modules") min_version, error_msg = min_versions[compiler_key] - if version < min_version: + if Version(version) < min_version: raise ConanInvalidConfiguration(error_msg) def set_version(self): @@ -101,14 +102,21 @@ def build_requirements(self): self.tool_requires("ninja/[^1.3.0]") self.requires("libhal-cmake-util/[^5.0.3]") if str(self.settings.os) != "baremetal": - self.test_requires("boost-ext-ut/2.3.1") + self.test_requires("boost-ext-ut/2.3.1", + options={'disable_module': False}) self.test_requires("benchmark/1.9.4") def requirements(self): pass def layout(self): - cmake_layout(self) + build_path = Path("build") / ( + str(self.settings.arch) + "-" + + str(self.settings.os) + "-" + + str(self.settings.compiler) + "-" + + str(self.settings.compiler.version) + ) + cmake_layout(self, build_folder=str(build_path)) def generate(self): tc = CMakeToolchain(self) @@ -124,6 +132,8 @@ def build(self): cmake = CMake(self) cmake.configure() cmake.build() + if not self.conf.get("tools.build:skip_test", default=False): + cmake.ctest(["--output-on-failure"]) def package(self): cmake = CMake(self) @@ -133,6 +143,9 @@ def package(self): dst=Path(self.package_folder) / "licenses", src=self.source_folder) + def package_id(self): + self.info.options.clear() + def package_info(self): # DISABLE Conan's config file generation self.cpp_info.set_property("cmake_find_mode", "none")