From 61ca0bda2ae1cf418e59f30b007cee2acd3e027e Mon Sep 17 00:00:00 2001 From: Petr Šabata Date: Nov 15 2018 11:41:59 +0000 Subject: Use single quotes to simplify regexes YAML double quoted strings interpret certain backslash escape sequences, breaing the regular expressions or making them harder to read. Let's use single quotes then. Signed-off-by: Petr Šabata --- diff --git a/drafts/module-tagging-service/format.md b/drafts/module-tagging-service/format.md index 9cbe51f..5d77ba4 100644 --- a/drafts/module-tagging-service/format.md +++ b/drafts/module-tagging-service/format.md @@ -43,20 +43,20 @@ A full example of a module rule: ``` rule: - name: "^a-full-name$" + name: '^a-full-name$' stream: - - "^either-this-stream$" - - "^or-this-one$" - - "-or-any-with-this-suffix$" + - '^either-this-stream$' + - '^or-this-one$' + - '-or-any-with-this-suffix$' # Any version, unnecessary - version: "\d+" + version: '\d+' dependencies: buildrequires: # Has a platform build dependency of any stream - platform: "^.*$" + platform: '^.*$' requires: # Matches Fedora platforms and stores it - platform: "^(?f\d+)$" + platform: '^(?f\d+)$' # scratch and development are bools scratch: no development: no @@ -65,7 +65,7 @@ rule: The above could then be tagged with the following: ``` -destinations: "\k{platform}-a-full-name-tag" +destinations: '\k{platform}-a-full-name-tag' ``` ## Detailed example diff --git a/drafts/module-tagging-service/rules.yaml b/drafts/module-tagging-service/rules.yaml index dca6471..50e6f74 100644 --- a/drafts/module-tagging-service/rules.yaml +++ b/drafts/module-tagging-service/rules.yaml @@ -10,20 +10,20 @@ type: module rule: name: - - "^javapackages-tools$" - - "-ursamajor$" + - '^javapackages-tools$' + - '-ursamajor$' # These two could be omitted in this case - stream: ".*" - version: ".*" + stream: '.*' + version: '.*' dependencies: buildrequires: # Also unnecessary - platform: "^.*$" + platform: '^.*$' requires: - platform: "^(?f\d+)$" + platform: '^(?f\d+)$' scratch: no development: no - destinations: "\k{platform}-modular-ursamajor" + destinations: '\k{platform}-modular-ursamajor' # This rule catches remaining non-scratch, non-development builds that can run # on Fedora and tags them based on their runtime dependencies. Again, the @@ -37,10 +37,10 @@ rule: dependencies: requires: - platform: "^(?f\d+)$" + platform: '^(?f\d+)$' scratch: no development: no - destinations: "\k{platform}-modular-updates-candidate" + destinations: '\k{platform}-modular-updates-candidate' # Matches any EPEL builds in a similar fashion and tags them into a differently # named tag. A build that depends on platform:[f28,el7] should be processed by @@ -51,10 +51,10 @@ type: module rule: dependencies: - runtime: "^(?el\d+)$" + runtime: '^(?el\d+)$' scratch: no development: no - destinations: "\k{platform}-epel-modular-updates-candidate" + destinations: '\k{platform}-epel-modular-updates-candidate' # Tags all scratch builds into a regularly GC'd tag. - id: Scratch builds @@ -62,7 +62,7 @@ type: module rule: scratch: yes - destinations: "modular-scratch-builds" + destinations: 'modular-scratch-builds' # Tags all development builds into a different, regularly GC'd tag. - id: Development builds @@ -70,10 +70,10 @@ type: module rule: development: yes - destinations: "modular-development-builds" + destinations: 'modular-development-builds' # A fallback tag for all the weird things that made it through our rules. - id: Fallback type: module description: Fallback for strange builds. - destinations: "modular-fallback-tag" + destinations: 'modular-fallback-tag'