Sobes.tech
Middle+

How can you prevent errors in advance so that developers do not make them before deploying changes to production and do not cause the application to crash?

sobes.tech AI

Answer from AI

Integration of version control systems with static code analysis tools, linters, and formatters. Setting up automatic checks during local commits (pre-commit hooks). Implementing a continuous integration (CI) pipeline with automatic execution of unit, integration, and contract tests on each push to the repository. Using tools for security analysis of code. Creating coding standards and regularly conducting code reviews.

# Example configuration of pre-commit for Python
repos:
  - repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.4.0
    hooks:
      - id: trailing-whitespace
      - id: end-of-file-fixer
      - id: check-yaml
      - id: check-added-large-files
  - repo: https://github.com/psf/black
    rev: 23.7.0
    hooks:
      - id: black
  - repo: https://github.com/pycqa/flake8
    rev: 6.1.0
    hooks:
      - id: flake8
# Example command for local test execution
pytest ./tests