From 342e3d38ef954dfc4d4c5b3cdc44fea7f7d8aaf9 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Mon, 29 Sep 2025 14:44:39 -0400 Subject: [PATCH 1/2] chore: add automatic validation with precommit on CI side pre-commit will auto-fix formatting and other minor things in the PRs (server-side!), without bugging contributors. Note how I only added the precommit config file, and the rest of the fixes were auto-contributed by the CI - without bugging the contributors or the maintainers Note that this requires the repo to be enabled in the https://pre-commit.ci/ --- .pre-commit-config.yaml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..6cb4eb6 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,40 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +exclude: | + (?x)^( + .+\.(dbc|DBC) + )$ + +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: check-added-large-files + - id: check-executables-have-shebangs + - id: check-json + - id: check-shebang-scripts-are-executable + exclude: '.+\.rs' # would be triggered by #![some_attribute] + - id: check-symlinks + - id: check-toml + - id: check-yaml + args: [ --allow-multiple-documents ] + - id: destroyed-symlinks + - id: end-of-file-fixer + - id: mixed-line-ending + args: [ --fix=lf ] + - id: trailing-whitespace + + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.5.5 + hooks: + - id: forbid-tabs + - id: remove-tabs + + - repo: local + hooks: + - id: cargo-fmt + name: Rust Format + description: "Automatically format Rust code with cargo fmt" + entry: sh -c "cargo fmt --all" + language: rust + pass_filenames: false From c2a66e83e97957f39f75343c72bcff61b2b16e11 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 06:40:01 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .gitignore | 2 +- LICENSE.md | 1 - TODO.md | 2 +- deny.toml | 6 +++--- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 869df07..96ef6c0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ /target -Cargo.lock \ No newline at end of file +Cargo.lock diff --git a/LICENSE.md b/LICENSE.md index c11a473..8a5b7c3 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/TODO.md b/TODO.md index 1a8405b..ea1fa2a 100644 --- a/TODO.md +++ b/TODO.md @@ -9,4 +9,4 @@ - [ ] Handle incomplete parsing by partially generating file to the point where the parser failed - [ ] Handle invalid c_string values and other values that can not easily be turned into ENUM names when generating ENUMS examples: - `VAL_ 2566722302 ReverseCurrentRangeSetting 31 "NotAvailable" 30 "Error" 16 "11101NotUsed" 15 "16" 14 "15" 13 "14" 12 "13" 11 "12" 10 "11" 9 "10" 8 "9" 7 "8" 6 "7" 5 "6" 4 "5" 3 "4" 2 "3" 1 "2" 0 "1";` - - `VAL_ 2560032510 LwVltgDscnnctDsredOperatingMode 15 "NoChange" 6 "1110Reserved" 5 "ManualConnect" 4 "ManualDisconnect" 1 "0011Reserved" 0 "Automatic";` \ No newline at end of file + - `VAL_ 2560032510 LwVltgDscnnctDsredOperatingMode 15 "NoChange" 6 "1110Reserved" 5 "ManualConnect" 4 "ManualDisconnect" 1 "0011Reserved" 0 "Automatic";` diff --git a/deny.toml b/deny.toml index 1039447..8f594ac 100644 --- a/deny.toml +++ b/deny.toml @@ -42,14 +42,14 @@ notice = "warn" # a note when they are encountered. ignore = [] # Threshold for security vulnerabilities, any vulnerability with a CVSS score -# lower than the range specified will be ignored. Note that ignored advisories +# lower than the range specified will be ignored. Note that ignored advisories # will still output a note when they are encountered. # * None - CVSS Score 0.0 # * Low - CVSS Score 0.1 - 3.9 # * Medium - CVSS Score 4.0 - 6.9 # * High - CVSS Score 7.0 - 8.9 # * Critical - CVSS Score 9.0 - 10.0 -#severity-threshold = +#severity-threshold = # This section is considered when running `cargo deny check licenses` # More documentation for the licenses section can be found here: @@ -75,7 +75,7 @@ copyleft = "warn" # * neither - The license will be denied if is FSF/Free *OR* OSI-approved allow-osi-fsf-free = "neither" # The confidence threshold for detecting a license from license text. -# The higher the value, the more closely the license text must be to the +# The higher the value, the more closely the license text must be to the # canonical license text of a valid SPDX license file. # [possible values: any between 0.0 and 1.0]. confidence-threshold = 0.8