Elektrine lite

← Feed

@jyn@tech.lgbt

Post #709117

2026-03-19 13:03 UTC

i'm having entirely too much fun at work editing 9000 lines of YAML with regex

Replies (2)

  • @jyn@tech.lgbt 2026-03-19 13:06

    this is based actually #!/usr/bin/env bash files=$(grep -r -E 'cfg\(not\(feature = "ferrocene_subset' -l library | grep -v 'library/stdarch/.*/generated.rs') for file in $files; do sed -i -e '/cfg(not(feature = "ferrocene_subset"/d' "$file" sed -i -e 's/\[cfg_attr(not(feature = "ferrocene_subset"), \(.*\))\]/[\1]/' "$file" done for yml in library/stdarch/crates/stdarch-gen-arm/spec/*/*.yml; do sed -i -e "/- FnCall: \[cfg.*\['feature = \"ferrocene_subset\"'/d" "$yml" sed -i -e "s/attr: \[FnCall: .*ferrocene_subset.*\]\], /attr: [/" "$yml" sed -i -e "s/attr: \[.neon-stable, FnCall.*ferrocene_subset.*/attr: [*neon-stable]/" "$yml" done cd library/stdarch ~/.cargo/bin/cargo +nightly run --bin=stdarch-gen-arm -- crates/stdarch-gen-arm/spec crates/core_arch/src cd ../.. ./x fmt

    Open ##1278461

  • @lambda@chaosfurs.social 2026-03-19 13:05

    @jyn ...actual fun or "please help me I'm dying" fun?

    Open ##1278464