shellfirm 0.3.8

`shellfirm` will intercept any risky patterns (default or defined by you) and prompt you a small challenge for double verification, kinda like a captcha for your terminal.
Documentation
---
# -- database:delete_all_rows --
- test: "DELETE FROM users;"
  description: "DELETE without WHERE clause deletes all rows in the table"
  expect_ids: ["database:delete_all_rows"]
- test: "delete from users;"
  description: "lowercase DELETE without WHERE clause"
  expect_ids: ["database:delete_all_rows"]
- test: "DELETE  FROM  orders;"
  description: "extra spaces in DELETE FROM still matches"
  expect_ids: ["database:delete_all_rows"]
- test: "DELETE FROM users WHERE id = 1"
  description: "DELETE with WHERE clause should not match delete_all_rows"
  expect_ids: []
- test: "delete from users where id = 1"
  description: "lowercase DELETE with WHERE clause should not match"
  expect_ids: []

# -- database:drop_database --
- test: "DROP DATABASE mydb"
  description: "dropping a database permanently deletes all its data"
  expect_ids: ["database:drop_database"]
- test: "drop database mydb"
  description: "lowercase drop database"
  expect_ids: ["database:drop_database"]
- test: "SELECT * FROM information_schema.schemata"
  description: "querying schema info should not trigger drop database check"
  expect_ids: []

# -- database:drop_table --
- test: "DROP TABLE users"
  description: "dropping a table permanently deletes all its data"
  expect_ids: ["database:drop_table"]
- test: "drop table users"
  description: "lowercase drop table"
  expect_ids: ["database:drop_table"]
- test: "SELECT * FROM users"
  description: "selecting from a table should not trigger drop table check"
  expect_ids: []

# -- database:truncate_table --
- test: "TRUNCATE TABLE users"
  description: "truncating a table deletes all rows permanently"
  expect_ids: ["database:truncate_table"]
- test: "truncate table users"
  description: "lowercase truncate table"
  expect_ids: ["database:truncate_table"]
- test: "TRUNCATE  TABLE  orders"
  description: "extra spaces in TRUNCATE TABLE still matches"
  expect_ids: ["database:truncate_table"]
- test: "SELECT COUNT(*) FROM users"
  description: "SELECT COUNT should not trigger truncate check"
  expect_ids: []

# -- database:update_all_rows --
- test: "UPDATE users SET active=false;"
  description: "UPDATE without WHERE clause modifies all rows in the table"
  expect_ids: ["database:update_all_rows"]
- test: "update users set active=false;"
  description: "lowercase UPDATE without WHERE clause"
  expect_ids: ["database:update_all_rows"]
- test: "UPDATE  orders  SET  status='cancelled';"
  description: "extra spaces in UPDATE SET still matches without WHERE"
  expect_ids: ["database:update_all_rows"]
- test: "UPDATE users SET active=false WHERE id = 1;"
  description: "UPDATE with WHERE clause should not match update_all_rows"
  expect_ids: []
- test: "update users set active=false where id = 1;"
  description: "lowercase UPDATE with WHERE clause should not match"
  expect_ids: []

# -- database — quoted and schema-qualified table names --
- test: "DELETE FROM `users`;"
  description: "BUG: backtick-quoted table, \\w+ doesn't match backticks"
  expect_ids: []

- test: "DROP TABLE `users`"
  description: "backtick-quoted table for DROP TABLE (uses \\s+ not \\w+)"
  expect_ids: ["database:drop_table"]

- test: "DELETE FROM public.users;"
  description: "BUG: schema.table, \\w+ doesn't match dot"
  expect_ids: []

- test: "UPDATE public.users SET active=false;"
  description: "BUG: schema-qualified UPDATE"
  expect_ids: []

- test: 'DELETE FROM "users";'
  description: "BUG: double-quoted table name"
  expect_ids: []

- test: "DELETE FROM users"
  description: "DELETE without semicolon"
  expect_ids: ["database:delete_all_rows"]

- test: "DELETE FROM users   "
  description: "DELETE with trailing whitespace"
  expect_ids: ["database:delete_all_rows"]

# -- database:drop_schema_role_user --
- test: "DROP SCHEMA public"
  description: "match DROP SCHEMA"
  expect_ids: ["database:drop_schema_role_user"]
- test: "DROP ROLE myrole"
  description: "match DROP ROLE"
  expect_ids: ["database:drop_schema_role_user"]
- test: "DROP USER myuser"
  description: "match DROP USER"
  expect_ids: ["database:drop_schema_role_user"]
- test: "drop schema test_schema"
  description: "match lowercase drop schema"
  expect_ids: ["database:drop_schema_role_user"]
- test: "CREATE SCHEMA newschema"
  description: "negative: CREATE SCHEMA should not match"
  expect_ids: []

# -- database:alter_drop_column --
- test: "ALTER TABLE users DROP COLUMN email"
  description: "match ALTER TABLE DROP COLUMN"
  expect_ids: ["database:alter_drop_column"]
- test: "alter table users drop column email"
  description: "match lowercase alter table drop column"
  expect_ids: ["database:alter_drop_column"]
- test: "ALTER TABLE users ADD COLUMN email VARCHAR(255)"
  description: "negative: ADD COLUMN should not match"
  expect_ids: []