Skip to content

Commit

Permalink
Add .gitattributes
Browse files Browse the repository at this point in the history
  • Loading branch information
djkoloski committed Oct 1, 2024
1 parent 28b02a0 commit c6b8e07
Show file tree
Hide file tree
Showing 7 changed files with 571 additions and 540 deletions.
8 changes: 4 additions & 4 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[build]
rustdocflags = ["--cfg", "docsrs"]

[env]
[build]
rustdocflags = ["--cfg", "docsrs"]

[env]
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github: rkyv
github: rkyv
286 changes: 143 additions & 143 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,143 +1,143 @@
name: CI

on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: "0 10 * * *"

permissions:
contents: read

env:
RUSTFLAGS: -Dwarnings

jobs:
features:
name: Features / ${{ matrix.std }} ${{ matrix.derive }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
bytecheck:
- ''
- bytecheck

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --verbose --tests --no-default-features --features "${{ matrix.bytecheck }}"

toolchain:
name: Toolchain / ${{ matrix.toolchain }} ${{ matrix.opt }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- beta
- nightly
opt:
- ''
- --release

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- run: cargo test --verbose ${{ matrix.opt }}

miri:
name: Miri / ${{ matrix.opt }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
opt:
- ''
- --release

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@miri
- run: cargo miri setup
- run: cargo miri test ${{ matrix.opt }} --verbose
env:
MIRIFLAGS: -Zmiri-disable-stacked-borrows -Zmiri-tree-borrows

test:
name: Test / ${{ matrix.target }} ${{ matrix.opt }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
opt:
- ''
- --release
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo test ${{ matrix.opt }}

cross:
name: Cross / ${{ matrix.target }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
target:
- i686-unknown-linux-gnu
- i586-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
- aarch64-unknown-linux-gnu
- thumbv6m-none-eabi

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo install cross
- run: cross build --no-default-features --features "bytecheck" --target ${{ matrix.target }} --verbose

format:
name: Format
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --check

clippy:
name: Clippy
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- run: cargo clippy

doc:
name: Doc
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: cargo doc
name: CI

on:
push:
pull_request:
workflow_dispatch:
schedule:
- cron: "0 10 * * *"

permissions:
contents: read

env:
RUSTFLAGS: -Dwarnings

jobs:
features:
name: Features / ${{ matrix.std }} ${{ matrix.derive }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
bytecheck:
- ''
- bytecheck

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --verbose --tests --no-default-features --features "${{ matrix.bytecheck }}"

toolchain:
name: Toolchain / ${{ matrix.toolchain }} ${{ matrix.opt }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toolchain:
- stable
- beta
- nightly
opt:
- ''
- --release

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- run: cargo test --verbose ${{ matrix.opt }}

miri:
name: Miri / ${{ matrix.opt }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
opt:
- ''
- --release

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@miri
- run: cargo miri setup
- run: cargo miri test ${{ matrix.opt }} --verbose
env:
MIRIFLAGS: -Zmiri-disable-stacked-borrows -Zmiri-tree-borrows

test:
name: Test / ${{ matrix.target }} ${{ matrix.opt }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
opt:
- ''
- --release
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo test ${{ matrix.opt }}

cross:
name: Cross / ${{ matrix.target }}
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
target:
- i686-unknown-linux-gnu
- i586-unknown-linux-gnu
- armv7-unknown-linux-gnueabihf
- aarch64-unknown-linux-gnu
- thumbv6m-none-eabi

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo install cross
- run: cross build --no-default-features --features "bytecheck" --target ${{ matrix.target }} --verbose

format:
name: Format
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --check

clippy:
name: Clippy
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- run: cargo clippy

doc:
name: Doc
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- run: cargo doc
60 changes: 30 additions & 30 deletions example.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
```rust
use core::mem::transmute;
use rend::*;

let little_int = i32_le::from_native(0x12345678);
// Internal representation is little-endian
assert_eq!(
[0x78, 0x56, 0x34, 0x12],
unsafe { transmute::<_, [u8; 4]>(little_int) }
);

// Can also be made with `.into()`
let little_int: i32_le = 0x12345678.into();
// Still formats correctly
assert_eq!("305419896", format!("{}", little_int));
assert_eq!("0x12345678", format!("0x{:x}", little_int));

let big_int = i32_be::from_native(0x12345678);
// Internal representation is big-endian
assert_eq!(
[0x12, 0x34, 0x56, 0x78],
unsafe { transmute::<_, [u8; 4]>(big_int) }
);

// Can also be made with `.into()`
let big_int: i32_be = 0x12345678.into();
// Still formats correctly
assert_eq!("305419896", format!("{}", big_int));
assert_eq!("0x12345678", format!("0x{:x}", big_int));
```
```rust
use core::mem::transmute;
use rend::*;

let little_int = i32_le::from_native(0x12345678);
// Internal representation is little-endian
assert_eq!(
[0x78, 0x56, 0x34, 0x12],
unsafe { transmute::<_, [u8; 4]>(little_int) }
);

// Can also be made with `.into()`
let little_int: i32_le = 0x12345678.into();
// Still formats correctly
assert_eq!("305419896", format!("{}", little_int));
assert_eq!("0x12345678", format!("0x{:x}", little_int));

let big_int = i32_be::from_native(0x12345678);
// Internal representation is big-endian
assert_eq!(
[0x12, 0x34, 0x56, 0x78],
unsafe { transmute::<_, [u8; 4]>(big_int) }
);

// Can also be made with `.into()`
let big_int: i32_be = 0x12345678.into();
// Still formats correctly
assert_eq!("305419896", format!("{}", big_int));
assert_eq!("0x12345678", format!("0x{:x}", big_int));
```
30 changes: 15 additions & 15 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
max_width = 80
comment_width = 80
wrap_comments = true
group_imports = "StdExternalCrate"
imports_granularity = "Crate"
condense_wildcard_suffixes = true
error_on_line_overflow = true
error_on_unformatted = true
format_code_in_doc_comments = true
format_macro_matchers = true
format_macro_bodies = true
format_strings = true
hex_literal_case = "Lower"
normalize_comments = true
use_field_init_shorthand = true
max_width = 80
comment_width = 80
wrap_comments = true
group_imports = "StdExternalCrate"
imports_granularity = "Crate"
condense_wildcard_suffixes = true
error_on_line_overflow = true
error_on_unformatted = true
format_code_in_doc_comments = true
format_macro_matchers = true
format_macro_bodies = true
format_strings = true
hex_literal_case = "Lower"
normalize_comments = true
use_field_init_shorthand = true
Loading

0 comments on commit c6b8e07

Please sign in to comment.