Skip to content

Commit

Permalink
Update preset regex and simplify Readme test
Browse files Browse the repository at this point in the history
Removed the unnecessary YML content manipulation from the Readme test in ReadmeTest.php. Furthermore, updated the regex pattern for alias in presets in the README.md file to case insensitive, easing the matching process. Improved the readability of the description for the preset_database.yml.
  • Loading branch information
SmetDenis committed Apr 6, 2024
1 parent 650ce56 commit dcb15c5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ In fact, this can be considered as partial inheritance.
- Schemas with presets validate themselves and if there are any obvious issues, you will see them when you try to use
the schema.
- Alias in presets must match the regex pattern
<!-- auto-update:preset-regex -->`^[a-z0-9_-]+$`<!-- auto-update:/preset-regex -->.
<!-- auto-update:preset-regex -->`/^[a-z0-9-_]+$/i`<!-- auto-update:/preset-regex -->.


Let's take a look at what this looks like in code.
Expand All @@ -953,7 +953,7 @@ of CSV files and rules. It will be much easier to achieve consistency. Very ofte
[preset_database.yml](schema-examples/preset_database.yml)
<!-- auto-update:preset-database-yml -->
```yml
name: Common presets for common database columns
name: Presets for database columns
description: This schema contains basic rules for database user data.

columns:
Expand Down
6 changes: 0 additions & 6 deletions tests/ReadmeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,7 @@ public function testCheckPresetFeaturesExampleInReadme(): void

public function testCheckPresetRegexInReadme(): void
{
$ymlContent = \implode(
"\n",
\array_slice(\explode("\n", \file_get_contents('./schema-examples/preset_features.yml')), 12),
);

$text = SchemaDataPrep::getAliasRegex();

Tools::insertInReadme('preset-regex', "`{$text}`", true);
}

Expand Down

0 comments on commit dcb15c5

Please sign in to comment.