Fix pre-commit issues (#2967)

diff --git a/.devcontainer/post_create.sh b/.devcontainer/post_create.sh
index b427fa8..14607e1 100644
--- a/.devcontainer/post_create.sh
+++ b/.devcontainer/post_create.sh
@@ -1,5 +1,3 @@
-#!/bin/bash
-
 sudo apt-get update
 sudo apt-get install -y libaspell-dev
 
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index a84ea01..491371d 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -30,7 +30,6 @@
     hooks:
       - id: no-commit-to-branch
         args: [--branch, main]
-      - id: check-toml
       - id: check-yaml
         args: [--unsafe]
       - id: debug-statements
@@ -48,7 +47,7 @@
       - id: check-case-conflict
       - id: check-toml
   - repo: https://github.com/adrienverge/yamllint.git
-    rev: v1.29.0
+    rev: v1.32.0
     hooks:
       - id: yamllint
         args:
@@ -56,37 +55,34 @@
           - -d
           - '{extends: relaxed, rules: {line-length: {max: 90}}}'
   - repo: https://github.com/charliermarsh/ruff-pre-commit
-    rev: v0.0.254
+    rev: v0.0.280
     hooks:
       - id: ruff
   - repo:  https://github.com/PyCQA/autoflake
-    rev: v2.0.1
+    rev: v2.2.0
     hooks:
       - id: autoflake
   - repo: https://github.com/psf/black
-    rev: 23.1.0
+    rev: 23.7.0
     hooks:
       - id: black
   - repo: https://github.com/codespell-project/codespell
-    rev: v2.2.2
+    rev: v2.2.5
     hooks:
       - id: codespell
         args: [--toml, pyproject-codespell.precommit-toml]
         additional_dependencies:
           - tomli
   - repo: https://github.com/abravalheri/validate-pyproject
-    rev: v0.12.1
+    rev: v0.13
     hooks:
       - id: validate-pyproject
   - repo: https://github.com/pre-commit/mirrors-mypy
-    rev: v0.991
+    rev: v1.4.1
     hooks:
       - id: mypy
-        args: [--no-warn-unused-ignores, --config-file, pyproject.toml, --disable-error-code,
-          import]
+        args: ["--config-file", "pyproject.toml"]
         additional_dependencies:
-          - chardet
           - pytest
-          - pytest-cov
-          - pytest-dependency
+          - tomli
           - types-chardet
diff --git a/Makefile b/Makefile
index a528e04..0c239e5 100644
--- a/Makefile
+++ b/Makefile
@@ -59,3 +59,6 @@
 
 clean:
 	rm -rf codespell.1
+
+mypy:
+	mypy .
diff --git a/codespell_lib/__init__.py b/codespell_lib/__init__.py
index cd77a55..4484dbd 100644
--- a/codespell_lib/__init__.py
+++ b/codespell_lib/__init__.py
@@ -1,4 +1,4 @@
 from ._codespell import _script_main, main
-from ._version import __version__
+from ._version import __version__  # type: ignore
 
 __all__ = ["_script_main", "main", "__version__"]
diff --git a/codespell_lib/_codespell.py b/codespell_lib/_codespell.py
index bdfd0a6..19999cd 100644
--- a/codespell_lib/_codespell.py
+++ b/codespell_lib/_codespell.py
@@ -26,7 +26,7 @@
 from typing import Dict, List, Match, Optional, Pattern, Sequence, Set, Tuple
 
 # autogenerated by setuptools_scm
-from ._version import __version__ as VERSION  # noqa: N812
+from ._version import __version__ as VERSION  # type: ignore  # noqa: N812
 
 word_regex_def = "[\\w\\-'’`]+"
 # While we want to treat characters like ( or " as okay for a starting break,
@@ -550,18 +550,18 @@
         toml_files.append(options.toml)
         tomllib_raise_error = True
     if toml_files:
-        try:
-            import tomllib  # type: ignore[import]
-        except ModuleNotFoundError:
+        if sys.version_info >= (3, 11):
+            import tomllib
+        else:
             try:
-                import tomli as tomllib
+                import tomli as tomllib  # type: ignore[no-redef]
             except ImportError as e:
                 if tomllib_raise_error:
                     raise ImportError(
                         f"tomllib or tomli are required to read pyproject.toml "
                         f"but could not be imported, got: {e}"
                     ) from None
-                tomllib = None
+                tomllib = None  # type: ignore[assignment]
         if tomllib is not None:
             for toml_file in toml_files:
                 with open(toml_file, "rb") as f:
diff --git a/pyproject.toml b/pyproject.toml
index c3348f1..2016102 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -98,6 +98,7 @@
 pretty = true
 show_error_codes = true
 strict = true
+warn_unused_ignores = false
 
 [tool.pytest.ini_options]
 addopts = "--cov=codespell_lib -rs --cov-report= --tb=short --junit-xml=junit-results.xml"