Skip to content

Instantly share code, notes, and snippets.

@heyajulia
Created April 27, 2024 12:18
Show Gist options
  • Save heyajulia/13b5d929de17f2a53d02f0ac43cf24d7 to your computer and use it in GitHub Desktop.
Save heyajulia/13b5d929de17f2a53d02f0ac43cf24d7 to your computer and use it in GitHub Desktop.
// Grab all Ruff rule categories from the Ruff docs.
// Run this in the browser console on https://docs.astral.sh/ruff/rules/.
const R = await import("https://esm.sh/ramda@0.29.1");
R.pipe(
R.tail,
R.pluck("innerText"),
R.map(R.match(/\(([A-Z0-9]+(?:, *[A-Z0-9]+)*)\)/)),
R.map(R.last),
R.chain(R.split(", ")),
R.map(R.trim)
)([...document.querySelectorAll("h2")]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment