Download the PHP package digitoimistodude/dude-coding-standards without Composer

On this page you can find all versions of the php package digitoimistodude/dude-coding-standards. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package dude-coding-standards

Dude Coding Standards (DCS)

[!NOTE] Please note: The Dude Coding Standard is a work in progress. We're in the process of replacing WordPress-Core standard in dudestack with our own DSC standard, the one you are currently looking at (internal reference: DEV-624). This PHPCS standard is used by Dude staff and may not provide additional value for external developers.

Packagist Version GitHub Actions Workflow Status

PHP_CodeSniffer and Stylelint rules for WordPress theme and plugin development at Digitoimisto Dude Oy.

This repository contains:


PHPCS Installation

The standard will be automatically registered with PHP_CodeSniffer via the Composer installer plugin.

Usage

In phpcs.xml

Create a phpcs.xml in your project root:

Command line

With custom configuration

You can override rules in your project's phpcs.xml:

What's included

DCS is based on WordPress Coding Standards with Dude-specific customizations:

Code style

Security

All WordPress security sniffs are enabled:

PHP compatibility

Checks code compatibility with > PHP 8.3 using PHPCompatibilityWP.

Development functions

error_log() and print_r() are allowed but flagged as warnings to remind you to review before deployment.

Excluded rules

The following WordPress rules are excluded for Dude's workflow:

Adding forbidden functions

To add more forbidden functions to your project, create a custom sniff or override in your phpcs.xml:

Development and local testing

If you want to test DCS locally before the package is published, first install dependencies in dude-coding-standards:

Then add path repository to your project's composer.json:

Run composer update in your project:

Note: Path repositories create symlinks, so any changes you make to dude-coding-standards are instantly available in your test project without reinstalling.

Check that DCS is available:

Create phpcs.xml in your project, can be as simple as this:

Run phpcs:

You can also run phpcs directly from dude-coding-standards against your project:

Check the standard itself for development:


Stylelint Config

Installation

Usage

Create .stylelintrc in your project root:

If you ever need to add project based exclusions, use rules in your project:

Overriding rules

See stylelint.config.js for all rules.


Contributing (Dude staff)

Adding excludes

When you encounter a rule that should be excluded globally, add it to DCS/ruleset.xml:

Important: Don't include full rulesets like <rule ref="Generic"> or <rule ref="Squiz">. WordPress already includes specific rules from these standards. Only disable individual rules that conflict with Dude's style.

Find the rule name from the phpcs error output (shown when using -s flag).

Release cycle

  1. Make changes to DCS/ruleset.xml
  2. Update CHANGELOG.md with new version and changes
  3. Commit and push:

  4. Tag a new release:

The GitHub Actions workflow will automatically create a release when a new tag is pushed.

Projects using the package can update with:

Note: Projects using path repository (symlink) get changes instantly without updating.


References


All versions of dude-coding-standards with dependencies

PHP Build Version
Package Version
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package digitoimistodude/dude-coding-standards contains the following files

Loading the files please wait ...