LogoLogo
  • Planet 4
  • Development
    • Contribute
    • Installation
    • Git Guidelines
    • Coding Standards
    • Continuous Delivery
  • CI/CD
    • Test Instances
    • Deployment
    • Testing
      • End-to-end Tests
      • Visual Regression Tests
  • NRO Customization
    • Development
      • Using Child Themes
      • Package Registry
      • Plugins
    • Testing
      • Visual Regression Tests
    • Deployment
      • Production
      • DB/Media Sync
  • Infrastructure
    • NRO Generation
    • ElasticSearch
    • Cloudflare
  • Recipes
    • Maintenance page
    • Production sync
    • Running commands
  • Platform
    • Practices
    • ADRs
      • [ADR-0001] Use Gitbook for Technical Documentation
      • [ADR-0002] P3 Archive elastic search integration
      • [ADR-0003] WYSIWYG Blocks Architecture
      • [ADR-0004] Switch to Monorepo
      • [ADR-0006] Define scope for deployment environments
      • [ADR-0008] PSR-4 Autoloading Standard
      • [ADR-0009] Include Media Library in master theme
      • [ADR-0011] PHP Coding Standards
      • [ADR-0012] Use custom SCSS syntax for variables
      • [ADR-0013] Choose a ticketing system
      • [ADR-0014] Choose a testing framework
      • [ADR-0015] Use block templates to build block patterns
      • [ADR-0016] Form Builder data retention policy
      • [ADR-0017] Move blocks into the theme
    • Changelog
      • 2024
      • 2023
      • 2022
      • 2021
      • 2020
      • 2019
      • 2018
  • Tech
    • Wordpress
    • Blocks
    • Plugins
    • Hooks
    • Data migrations
    • CSS variables
Powered by GitBook
On this page
  • Backend
  • PHP
  • Python
  • Frontend
  • React
  • Sass
  • Security & Analysis
  • Testing
  • Documentation
Edit on GitHub
  1. Development

Coding Standards

Basic standards and linting configuration

PreviousGit GuidelinesNextContinuous Delivery

Last updated 1 year ago

Besides the language specific standards below, we always include an file in code repositories for easier IDE configuration. Most IDEs either support this by default or need .

Backend

PHP

Since we depend on WordPress, PHP is the main language we use for backend development.

We follow as a base for coding standards, but with some exceptions and additions. To make it easier to lint our code, either in CI or locally in the IDE, we always include a file to the root of all of our code repositories.

We also rely on for autoloading.

We use for managing dependencies.

Python

Python is also being used for certain use cases. Mainly for scripting and functionality that needs to run in a pipeline. In most cases this is done to avoid writing shell scripts that are harder to read and maintain.

We follow PEP8 as a base for coding standards. We include a file in our code repositories to enable linting.

We use for managing dependencies.

Frontend

For all frontend dependencies we use package manager and for building and bundling assets for production.

React

Sass

Security & Analysis

Testing

Documentation

Besides using vanilla Javascript, in some cases we also rely on the framework for most of our frontend work.

We are using to enforce coding standards that extends WordPress eslint configuration. We include an file in our code repositories.

Besides using vanilla CSS, when the complexity increases we rely on to achieve better readability and maintenance.

We include a file to enforce linting and certain syntax rules.

We use for automated auditing of new code during our Pull Requests pipelines. We also have enabled vulnerability scanning and automated packages security updates on GitHub.

We use for “end to end” testing. It’s a Javascript based framework, used also by Wordpress.

For technical documentation we use . Since the project is open source, the documentation is also and it’s automatically synced with a .

.editorconfig
a plugin
PSR-12
phpcs.xml.dist
PSR-4
composer
setup.cfg
pip
npm
webpack
React
ESlint
.eslintrc.json
Sass
.stylelintrc
SonarCloud
Playwright
Gitbook
publicly available
code repository