CI move code directives to pre-commit, remove some outdated checks
Moving checks for incorrect code block or IPython directives to pre-commit so they're cross-platform and give faster feedback to devs.

Also removing some no-longer-necessary code checks:

- "Check that no file in the repo contains trailing whitespaces" is taken care of by the `trailing-whitespace` hook
- "Check for extra blank lines after the class definition" is enforced by `black`