mirror of
https://github.com/extism/extism.git
synced 2026-01-09 05:47:54 -05:00
ci: check formatting of all crates (#598)
Check formatting of all crates to ensure the whole codebase stays formatted.
This commit is contained in:
2
.github/workflows/ci-rust.yml
vendored
2
.github/workflows/ci-rust.yml
vendored
@@ -82,7 +82,7 @@ jobs:
|
||||
path: target/**
|
||||
key: ${{ runner.os }}-target-${{ github.sha }}
|
||||
- name: Format
|
||||
run: cargo fmt --check -p ${{ env.RUNTIME_CRATE }}
|
||||
run: cargo fmt --check
|
||||
- name: Lint
|
||||
run: cargo clippy --release --all-features --no-deps -p ${{ env.RUNTIME_CRATE }}
|
||||
- name: Test
|
||||
|
||||
@@ -13,20 +13,21 @@ fn rewrite(line: &'_ str) -> Option<Cow<'_, str>> {
|
||||
|
||||
if cfg!(target_os = "macos") {
|
||||
if line.starts_with("typedef __builtin_va_list ") {
|
||||
return None
|
||||
return None;
|
||||
}
|
||||
} else if cfg!(target_os = "windows") {
|
||||
if line.contains("__gnuc_va_list") ||
|
||||
line.starts_with("__pragma") ||
|
||||
line.contains("__attribute__") ||
|
||||
line.contains("uintptr_t") ||
|
||||
line.contains("intptr_t") ||
|
||||
line.contains("size_t") ||
|
||||
line.contains("ptrdiff_t") {
|
||||
return None
|
||||
if line.contains("__gnuc_va_list")
|
||||
|| line.starts_with("__pragma")
|
||||
|| line.contains("__attribute__")
|
||||
|| line.contains("uintptr_t")
|
||||
|| line.contains("intptr_t")
|
||||
|| line.contains("size_t")
|
||||
|| line.contains("ptrdiff_t")
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
||||
return Some(Cow::Owned(line.replace("__attribute__((__cdecl__))", "")))
|
||||
return Some(Cow::Owned(line.replace("__attribute__((__cdecl__))", "")));
|
||||
};
|
||||
|
||||
Some(Cow::Borrowed(line))
|
||||
@@ -52,6 +53,5 @@ fn main() {
|
||||
.collect::<Vec<Cow<'_, str>>>()
|
||||
.join("\n\n");
|
||||
|
||||
|
||||
std::fs::write("../target/header.h", data).unwrap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user