@sinemacula/coding-standards 1.12.2 → 1.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +67 -59
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -98,10 +98,16 @@ After installing the npm package, extend the shared Biome config from your proje
98
98
  {
99
99
  "$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
100
100
  "root": true,
101
- "extends": ["@sinemacula/coding-standards/js/biome.json"],
101
+ "extends": [
102
+ "@sinemacula/coding-standards/js/biome.json"
103
+ ],
102
104
  "files": {
103
105
  "ignoreUnknown": true,
104
- "includes": ["**", "!**/node_modules/**", "!**/vendor/**"]
106
+ "includes": [
107
+ "**",
108
+ "!**/node_modules/**",
109
+ "!**/vendor/**"
110
+ ]
105
111
  }
106
112
  }
107
113
  ```
@@ -194,7 +200,9 @@ package_filters = [
194
200
  ```json
195
201
  {
196
202
  "$schema": "https://unpkg.com/knip@6/schema.json",
197
- "extends": ["@sinemacula/coding-standards/js/knip.json"]
203
+ "extends": [
204
+ "@sinemacula/coding-standards/js/knip.json"
205
+ ]
198
206
  }
199
207
  ```
200
208
 
@@ -212,20 +220,20 @@ tag = "<version>"
212
220
 
213
221
  ## What's Included
214
222
 
215
- | Path | Tool | Description |
216
- |-------------------------------|--------------|--------------------------------------------------------|
217
- | `src/PhpCsFixerConfig.php` | PHP CS Fixer | Factory class for building PHP CS Fixer configurations |
218
- | `php/.php-cs-fixer.rules.php` | PHP CS Fixer | Shared rules array (PSR-12 base + org conventions) |
219
- | `SineMacula/ruleset.xml` | PHPCS | Auto-discovered coding standard (PSR-12 + exclusions) |
220
- | `php/phpstan-base.neon` | PHPStan | Base config (org-wide ignored errors + settings) |
221
- | `js/biome.json` | Biome | JavaScript / TypeScript formatter + linter rules |
222
- | `js/knip.json` | Knip | Unused-export detection rules |
223
- | `js/eslint/` | ESLint | Structural, type-aware + Vue rules; runs with Biome |
224
- | `markdown/.markdownlint.json` | markdownlint | Markdown linting rules |
225
- | `yaml/.yamllint.yaml` | yamllint | YAML linting rules |
226
- | `shell/.shellcheckrc` | ShellCheck | Shell script linting rules |
227
- | `security/.gitleaks.toml` | Gitleaks | Secret-detection ruleset |
228
- | `editorconfig/.editorconfig-checker.json` | editorconfig-checker | Disables only the max-line-length check |
223
+ | Path | Tool | Description |
224
+ |-------------------------------------------|----------------------|--------------------------------------------------------|
225
+ | `src/PhpCsFixerConfig.php` | PHP CS Fixer | Factory class for building PHP CS Fixer configurations |
226
+ | `php/.php-cs-fixer.rules.php` | PHP CS Fixer | Shared rules array (PSR-12 base + org conventions) |
227
+ | `SineMacula/ruleset.xml` | PHPCS | Auto-discovered coding standard (PSR-12 + exclusions) |
228
+ | `php/phpstan-base.neon` | PHPStan | Base config (org-wide ignored errors + settings) |
229
+ | `js/biome.json` | Biome | JavaScript / TypeScript formatter + linter rules |
230
+ | `js/knip.json` | Knip | Unused-export detection rules |
231
+ | `js/eslint/` | ESLint | Structural, type-aware + Vue rules; runs with Biome |
232
+ | `markdown/.markdownlint.json` | markdownlint | Markdown linting rules |
233
+ | `yaml/.yamllint.yaml` | yamllint | YAML linting rules |
234
+ | `shell/.shellcheckrc` | ShellCheck | Shell script linting rules |
235
+ | `security/.gitleaks.toml` | Gitleaks | Secret-detection ruleset |
236
+ | `editorconfig/.editorconfig-checker.json` | editorconfig-checker | Disables only the max-line-length check |
229
237
 
230
238
  ## Rules
231
239
 
@@ -235,38 +243,38 @@ native directive - `// phpcs:ignore <code>` for a sniff, `@phpstan-ignore <ident
235
243
 
236
244
  ### PHPCS sniffs
237
245
 
238
- | Sniff | Enforces |
239
- |-------|----------|
240
- | `SineMacula.Attributes.DisallowToolingAttribute` | No IDE/tooling attributes (e.g. `JetBrains\PhpStorm`). |
241
- | `SineMacula.Classes.RequireFinalClass` | Concrete classes must be `final` or `abstract` (`@inheritable` opts out). |
242
- | `SineMacula.Classes.RequireReadonlyPublicProperty` | Public properties (declared or promoted) must be `readonly`. |
243
- | `SineMacula.Commenting.CommentLineLength` | Standalone comment lines must not exceed 80 chars (FQCN/URL exempt). |
244
- | `SineMacula.Commenting.ConsistentEnumCaseComments` | Enum case docs are all-or-nothing within an enum. |
245
- | `SineMacula.Commenting.MultilineMethodComment` | A method's doc comment must span multiple lines. |
246
- | `SineMacula.Commenting.RequireConstantComment` | Every class/interface/enum/trait constant needs a doc comment. |
247
- | `SineMacula.Commenting.RequireCopyrightTag` | Class/interface/enum/trait docblocks must carry an `@copyright` tag. |
248
- | `SineMacula.Commenting.RequireNonPromotedParameterComment` | Plain params mixed with promoted ones need a comment. |
249
- | `SineMacula.Commenting.RequirePromotedPropertyComment` | Every constructor-promoted property needs a doc comment. |
250
- | `SineMacula.Commenting.SingleLineMemberComment` | A property, constant or enum-case doc comment sits on one line. |
251
- | `SineMacula.Exceptions.DisallowBaseException` | No throwing the base `\Exception`; throw a domain exception. |
252
- | `SineMacula.Exceptions.RequireEmptyCatchComment` | An empty catch block must comment its intentional swallow. |
253
- | `SineMacula.Functions.RequireSensitiveParameter` | Secret-named params need `#[\SensitiveParameter]`. |
254
- | `SineMacula.Metrics.MaxMethodCount` | A class/interface/trait/enum may declare at most 20 methods (tests exempt). |
255
- | `SineMacula.Metrics.MethodLength` | A method body may have at most 50 significant lines (tests exempt). |
256
- | `SineMacula.Namespaces.RequireConcernsNamespace` | Traits must live under a `Concerns` namespace segment. |
257
- | `SineMacula.Namespaces.RequireContractsNamespace` | Interfaces must live under a `Contracts` namespace segment. |
258
- | `SineMacula.Namespaces.RequireEnumsNamespace` | Enums must live under an `Enums` namespace segment. |
259
- | `SineMacula.NamingConventions.BooleanMethodName` | `bool` methods are predicates; command verbs/@imperative exempt. |
260
- | `SineMacula.NamingConventions.DisallowInterfacePrefix` | Interface names must not use the Hungarian `I` prefix. |
261
- | `SineMacula.NamingConventions.ValidEnumCaseName` | Enum cases must be `SCREAMING_SNAKE_CASE`. |
262
- | `SineMacula.NamingConventions.ValidGlobalFunctionName` | Global functions must be declared in `snake_case`. |
263
- | `SineMacula.TypeHints.RequireConstantType` | Class/interface/enum/trait constants must declare a native type. |
264
- | `SineMacula.WhiteSpace.PromotedConstructorSpacing` | Blank line above each promoted-constructor parameter. |
246
+ | Sniff | Enforces |
247
+ |------------------------------------------------------------|-----------------------------------------------------------------------------|
248
+ | `SineMacula.Attributes.DisallowToolingAttribute` | No IDE/tooling attributes (e.g. `JetBrains\PhpStorm`). |
249
+ | `SineMacula.Classes.RequireFinalClass` | Concrete classes must be `final` or `abstract` (`@inheritable` opts out). |
250
+ | `SineMacula.Classes.RequireReadonlyPublicProperty` | Public properties (declared or promoted) must be `readonly`. |
251
+ | `SineMacula.Commenting.CommentLineLength` | Standalone comment lines must not exceed 80 chars (FQCN/URL exempt). |
252
+ | `SineMacula.Commenting.ConsistentEnumCaseComments` | Enum case docs are all-or-nothing within an enum. |
253
+ | `SineMacula.Commenting.MultilineMethodComment` | A method's doc comment must span multiple lines. |
254
+ | `SineMacula.Commenting.RequireConstantComment` | Every class/interface/enum/trait constant needs a doc comment. |
255
+ | `SineMacula.Commenting.RequireCopyrightTag` | Class/interface/enum/trait docblocks must carry an `@copyright` tag. |
256
+ | `SineMacula.Commenting.RequireNonPromotedParameterComment` | Plain params mixed with promoted ones need a comment. |
257
+ | `SineMacula.Commenting.RequirePromotedPropertyComment` | Every constructor-promoted property needs a doc comment. |
258
+ | `SineMacula.Commenting.SingleLineMemberComment` | A property, constant or enum-case doc comment sits on one line. |
259
+ | `SineMacula.Exceptions.DisallowBaseException` | No throwing the base `\Exception`; throw a domain exception. |
260
+ | `SineMacula.Exceptions.RequireEmptyCatchComment` | An empty catch block must comment its intentional swallow. |
261
+ | `SineMacula.Functions.RequireSensitiveParameter` | Secret-named params need `#[\SensitiveParameter]`. |
262
+ | `SineMacula.Metrics.MaxMethodCount` | A class/interface/trait/enum may declare at most 20 methods (tests exempt). |
263
+ | `SineMacula.Metrics.MethodLength` | A method body may have at most 50 significant lines (tests exempt). |
264
+ | `SineMacula.Namespaces.RequireConcernsNamespace` | Traits must live under a `Concerns` namespace segment. |
265
+ | `SineMacula.Namespaces.RequireContractsNamespace` | Interfaces must live under a `Contracts` namespace segment. |
266
+ | `SineMacula.Namespaces.RequireEnumsNamespace` | Enums must live under an `Enums` namespace segment. |
267
+ | `SineMacula.NamingConventions.BooleanMethodName` | `bool` methods are predicates; command verbs/@imperative exempt. |
268
+ | `SineMacula.NamingConventions.DisallowInterfacePrefix` | Interface names must not use the Hungarian `I` prefix. |
269
+ | `SineMacula.NamingConventions.ValidEnumCaseName` | Enum cases must be `SCREAMING_SNAKE_CASE`. |
270
+ | `SineMacula.NamingConventions.ValidGlobalFunctionName` | Global functions must be declared in `snake_case`. |
271
+ | `SineMacula.TypeHints.RequireConstantType` | Class/interface/enum/trait constants must declare a native type. |
272
+ | `SineMacula.WhiteSpace.PromotedConstructorSpacing` | Blank line above each promoted-constructor parameter. |
265
273
 
266
274
  ### PHPStan rules
267
275
 
268
- | Identifier | Enforces |
269
- |------------|----------|
276
+ | Identifier | Enforces |
277
+ |------------------------------------|-------------------------------------------------------------------|
270
278
  | `sineMacula.mutableStaticProperty` | Static properties written at runtime; `@managed-static` opts out. |
271
279
 
272
280
  ### ESLint rules
@@ -274,19 +282,19 @@ native directive - `// phpcs:ignore <code>` for a sniff, `@phpstan-ignore <ident
274
282
  All rules run in the base layer except `boolean-method-name`, which resolves return types and so requires the opt-in
275
283
  type-checked layer.
276
284
 
277
- | Rule | Enforces |
278
- |------|----------|
279
- | `@sinemacula/no-interface-prefix` | Interface and type-alias names must not use the Hungarian `I` prefix. |
280
- | `@sinemacula/require-readonly-public-property` | Public class properties (declared or promoted) must be `readonly`. |
281
- | `@sinemacula/valid-enum-member-name` | Enum members must be declared in `SCREAMING_SNAKE_CASE`. |
282
- | `@sinemacula/boolean-method-name` | Boolean-returning methods need an is/has/can prefix; `@imperative` exempt. |
283
- | `@sinemacula/no-mutable-static` | No mutable exported bindings or mutable `static` class fields; test code exempt. |
284
- | `@sinemacula/max-methods-per-class` | A single class may declare at most 20 methods; test code exempt. |
285
- | `@sinemacula/no-base-error` | Throw a domain-specific `Error` subclass, never the base `Error`; test code exempt. |
286
- | `@sinemacula/require-copyright` | Every file must carry a documentation comment with `@copyright` and `@author`. |
287
- | `@sinemacula/align-doc-tags` | `@author` and `@copyright` values line up at a single column; autofixable. |
288
- | `@sinemacula/single-line-property-doc` | A data member's documentation comment sits on one line; autofixable. |
289
- | `@sinemacula/multiline-function-doc` | A method's documentation comment spans multiple lines; autofixable. |
285
+ | Rule | Enforces |
286
+ |------------------------------------------------|-------------------------------------------------------------------------------------|
287
+ | `@sinemacula/no-interface-prefix` | Interface and type-alias names must not use the Hungarian `I` prefix. |
288
+ | `@sinemacula/require-readonly-public-property` | Public class properties (declared or promoted) must be `readonly`. |
289
+ | `@sinemacula/valid-enum-member-name` | Enum members must be declared in `SCREAMING_SNAKE_CASE`. |
290
+ | `@sinemacula/boolean-method-name` | Boolean-returning methods need an is/has/can prefix; `@imperative` exempt. |
291
+ | `@sinemacula/no-mutable-static` | No mutable exported bindings or mutable `static` class fields; test code exempt. |
292
+ | `@sinemacula/max-methods-per-class` | A single class may declare at most 20 methods; test code exempt. |
293
+ | `@sinemacula/no-base-error` | Throw a domain-specific `Error` subclass, never the base `Error`; test code exempt. |
294
+ | `@sinemacula/require-copyright` | Every file must carry a documentation comment with `@copyright` and `@author`. |
295
+ | `@sinemacula/align-doc-tags` | `@author` and `@copyright` values line up at a single column; autofixable. |
296
+ | `@sinemacula/single-line-property-doc` | A data member's documentation comment sits on one line; autofixable. |
297
+ | `@sinemacula/multiline-function-doc` | A method's documentation comment spans multiple lines; autofixable. |
290
298
 
291
299
  `boolean-method-name` takes `additionalPrefixes`, `additionalPredicates` and `additionalCommandVerbs` (string arrays)
292
300
  to widen the accepted vocabulary from a consumer config. `max-methods-per-class` takes `max`, `no-base-error` takes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sinemacula/coding-standards",
3
- "version": "1.12.2",
3
+ "version": "1.12.3",
4
4
  "description": "Centralized coding standards, static analysis configurations, and code quality tooling for all Sine Macula repositories.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Ben Carey <bdmc@sinemacula.co.uk>",