Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

Commit

Permalink
Add pre-commit ci
Browse files Browse the repository at this point in the history
  • Loading branch information
someone13574 committed Jun 6, 2024
1 parent 656b026 commit 4c45e2c
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 17 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install Rust nightly
uses: actions-rs/[email protected]
with:
toolchain: nightly
profile: minimal
components: rustfmt
- uses: pre-commit/[email protected]
38 changes: 23 additions & 15 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-toml
- id: mixed-line-ending
- repo: https://github.com/Lucas-C/pre-commit-hooks
- id: check-added-large-files
- id: check-case-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.5
hooks:
- id: remove-crlf
- id: forbid-tabs
- id: remove-crlf
- id: forbid-tabs
exclude: "Makefile$"
- repo: https://github.com/doublify/pre-commit-rust
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
- id: cargo-check
- id: clippy
- repo: https://github.com/pocc/pre-commit-hooks
- id: clippy
- repo: local
hooks:
- id: fmt
name: fmt
entry: cargo +nightly fmt
language: system
types: [rust]
args: ["--"]
- repo: https://github.com/pocc/pre-commit-hooks
rev: v1.3.5
hooks:
- id: clang-format
- id: clang-format
args: ["--style=WebKit", "-i"]
2 changes: 2 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
imports_granularity = "Module"
group_imports = "StdExternalCrate"
4 changes: 3 additions & 1 deletion src/create_mem_init.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use std::{fs, io::Write, path::Path};
use std::fs;
use std::io::Write;
use std::path::Path;

pub fn create_mem_init<P: AsRef<Path>>(src: P, dst: P) {
let dst = dst.as_ref();
Expand Down
3 changes: 2 additions & 1 deletion src/generate_microcode.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::microcode::{generators::*, signals::*};
use crate::microcode::generators::*;
use crate::microcode::signals::*;

struct Operation {
microcode: u32,
Expand Down

0 comments on commit 4c45e2c

Please sign in to comment.