-
Notifications
You must be signed in to change notification settings - Fork 13
Pastey crate requirement #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| # ******************************************************************************* | ||
| # Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| # | ||
| # See the NOTICE file(s) distributed with this work for additional | ||
| # information regarding copyright ownership. | ||
| # | ||
| # This program and the accompanying materials are made available under the | ||
| # terms of the Apache License Version 2.0 which is available at | ||
| # https://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # ******************************************************************************* | ||
|
|
||
| load("@trlc//:trlc.bzl", "trlc_requirements") | ||
|
|
||
| trlc_requirements( | ||
| name = "system_requirements", | ||
| srcs = [ | ||
| "assumed_system_requirements.trlc", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| ) | ||
|
|
||
| trlc_requirements( | ||
| name = "feature_requirements", | ||
| srcs = [ | ||
| "feature_requirements.trlc", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| deps = [ | ||
| ":system_requirements", | ||
| ], | ||
| ) | ||
|
|
||
| trlc_requirements( | ||
| name = "component_requirements", | ||
| srcs = [ | ||
| "component_requirements.trlc", | ||
| ], | ||
| visibility = ["//visibility:public"], | ||
| deps = [ | ||
| ":system_requirements", | ||
| ":feature_requirements", | ||
| ], | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /******************************************************************************** | ||
| * Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| * | ||
| * See the NOTICE file(s) distributed with this work for additional | ||
| * information regarding copyright ownership. | ||
| * | ||
| * This program and the accompanying materials are made available under the | ||
| * terms of the Apache License Version 2.0 which is available at | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| ********************************************************************************/ | ||
| package PasteySysReq | ||
|
|
||
| import ScoreReq | ||
|
|
||
| ScoreReq.AssumedSystemReq ASR_PASTEY_001 { | ||
| description = "The Rust compiler shall support procedural macro invocation that transforms token streams at compile time, including accepting raw identifiers (r#ident) and #[doc = ...] attribute tokens emitted from a procedural macro as syntactically valid output" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wrong understanding of assumed System Requirements: it does not describe the assumption of what the system (here the Rust compiler, which is not part of our SW platform) would provide for your component/crate but what you think the system expects from "paste! macro". These would be "Assumptions of Use" and I think be documented in the feature requirements trlc. And it should be on a level like https://eclipse-score.github.io/score/main/requirements/stakeholder/index.html#stkh_req__dev_experience__prog_languages (from user of the platform perspective).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have updated system requirement in term of
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need to discuss this
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed in meeting to replace these by a assumed system requirment like https://eclipse-score.github.io/score/main/requirements/stakeholder/index.html#stkh_req__dev_experience__prog_languages and to create an AoU on feature level stating that pastey crate expects "qualified Rust compiler including macro infrastructure". AoU in trlc: see https://github.com/eclipse-score/communication/blob/main/score/mw/com/dependability/safety_analysis/aou.trlc |
||
| safety = ScoreReq.Asil.B | ||
| version = 1 | ||
| rationale = "The paste! macro relies on the Rust procedural macro system to perform compile-time identifier synthesis inside [< ... >] blocks, this single capability covers identifier concatenation, case modifiers, the replace modifier, raw identifier generation, and documentation string assembly" | ||
| } | ||
|
|
||
| ScoreReq.AssumedSystemReq ASR_PASTEY_002 { | ||
| description = "The Rust build environment shall expose named environment variables to procedural macros at compile time so that their values can be incorporated into generated identifiers" | ||
| safety = ScoreReq.Asil.B | ||
| version = 1 | ||
| rationale = "pastey supports env!(\"VAR_NAME\") inside [< ... >] which requires compile-time read access to the host build environment variables" | ||
| } | ||
|
aschemmel-tech marked this conversation as resolved.
aschemmel-tech marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| /******************************************************************************** | ||
| * Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| * | ||
| * See the NOTICE file(s) distributed with this work for additional | ||
| * information regarding copyright ownership. | ||
| * | ||
| * This program and the accompanying materials are made available under the | ||
| * terms of the Apache License Version 2.0 which is available at | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| ********************************************************************************/ | ||
| package PasteyComReq | ||
|
|
||
| import ScoreReq | ||
|
|
||
| ScoreReq.CompReq REQ_COMP_PASTEY_001 { | ||
| description = "The token parser component shall collect all tokens inside [< ... >] and shall discard whitespace tokens between them before performing identifier concatenation" | ||
|
aschemmel-tech marked this conversation as resolved.
Outdated
aschemmel-tech marked this conversation as resolved.
Outdated
|
||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteyFeaReq.FEAT_PASTEY_001@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.CompReq REQ_COMP_PASTEY_002 { | ||
| description = "The case conversion component shall apply str::to_lowercase to the accumulated identifier string when the :lower modifier is present" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteyFeaReq.FEAT_PASTEY_002@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.CompReq REQ_COMP_PASTEY_003 { | ||
| description = "The case conversion component shall apply str::to_uppercase to the accumulated identifier string when the :upper modifier is present" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteyFeaReq.FEAT_PASTEY_003@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.CompReq REQ_COMP_PASTEY_004 { | ||
| description = "The case conversion component shall convert the accumulated identifier string to snake_case when the :snake modifier is present" | ||
|
aschemmel-tech marked this conversation as resolved.
Outdated
|
||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteyFeaReq.FEAT_PASTEY_004@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.CompReq REQ_COMP_PASTEY_005 { | ||
| description = "The case conversion component shall convert the accumulated identifier string to UpperCamelCase when the :camel or :upper_camel modifier is present" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteyFeaReq.FEAT_PASTEY_005@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.CompReq REQ_COMP_PASTEY_006 { | ||
| description = "The case conversion component shall convert the accumulated identifier string to lowerCamelCase when the :lower_camel modifier is present" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteyFeaReq.FEAT_PASTEY_006@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.CompReq REQ_COMP_PASTEY_007 { | ||
| description = "The case conversion component shall convert the accumulated identifier string to UpperCamelCase while preserving edge-case boundaries such as consecutive uppercase letter sequences when the :camel_edge modifier is present" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteyFeaReq.FEAT_PASTEY_007@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.CompReq REQ_COMP_PASTEY_008 { | ||
| description = "The replace modifier parser component shall accept exactly one token for each of the from and to arguments and shall emit a compile error when more than one token is supplied for either argument, when no preceding value exists, or when the modifier syntax is malformed" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteyFeaReq.FEAT_PASTEY_008@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.CompReq REQ_COMP_PASTEY_009 { | ||
| description = "The raw identifier component shall detect a leading # token as the very first token inside [< ... >], shall set raw mode and produce an r#ident output token, and shall emit a compile error if # appears at any position other than the first" | ||
|
aschemmel-tech marked this conversation as resolved.
Outdated
|
||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteyFeaReq.FEAT_PASTEY_009@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.CompReq REQ_COMP_PASTEY_010 { | ||
| description = "The documentation string component shall collect the string values of all #[doc = ...] attribute arguments within a paste! invocation and shall concatenate them in order into a single documentation string" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteyFeaReq.FEAT_PASTEY_010@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.CompReq REQ_COMP_PASTEY_011 { | ||
| description = "The environment expansion component shall look up the named variable in the compile-time environment, shall replace all hyphens in the resolved string with underscores, and shall emit a compile error when the variable is absent from the build environment" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteyFeaReq.FEAT_PASTEY_011@1] | ||
| version = 1 | ||
| } | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Discussed in meeting: our preferred solution was to have one feature collecting several crates (components) - which would mean that the feature level requirements could be even more abstract. Folder structure can be kept. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| /******************************************************************************** | ||
| * Copyright (c) 2026 Contributors to the Eclipse Foundation | ||
| * | ||
| * See the NOTICE file(s) distributed with this work for additional | ||
| * information regarding copyright ownership. | ||
| * | ||
| * This program and the accompanying materials are made available under the | ||
| * terms of the Apache License Version 2.0 which is available at | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| ********************************************************************************/ | ||
| package PasteyFeatReq | ||
|
|
||
| import ScoreReq | ||
|
|
||
| ScoreReq.FeatReq FEAT_PASTEY_001 { | ||
| description = "The paste! macro shall concatenate all identifier tokens listed inside [< ... >] into a single identifier and shall ignore any whitespace tokens between them" | ||
|
aschemmel-tech marked this conversation as resolved.
Outdated
|
||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteySysReq.ASR_PASTEY_001@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.FeatReq FEAT_PASTEY_002 { | ||
| description = "The paste! macro shall support the :lower modifier, which shall convert the pasted identifier value to lowercase" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteySysReq.ASR_PASTEY_001@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.FeatReq FEAT_PASTEY_003 { | ||
| description = "The paste! macro shall support the :upper modifier, which shall convert the pasted identifier value to uppercase" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteySysReq.ASR_PASTEY_001@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.FeatReq FEAT_PASTEY_004 { | ||
| description = "The paste! macro shall support the :snake modifier, which shall convert the pasted identifier value to snake_case" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteySysReq.ASR_PASTEY_001@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.FeatReq FEAT_PASTEY_005 { | ||
| description = "The paste! macro shall support the :camel and :upper_camel modifiers, which shall convert the pasted identifier value to UpperCamelCase" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteySysReq.ASR_PASTEY_001@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.FeatReq FEAT_PASTEY_006 { | ||
| description = "The paste! macro shall support the :lower_camel modifier, which shall convert the pasted identifier value to lowerCamelCase" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteySysReq.ASR_PASTEY_001@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.FeatReq FEAT_PASTEY_007 { | ||
| description = "The paste! macro shall support the :camel_edge modifier, which shall convert the pasted identifier value to UpperCamelCase while preserving edge-case boundaries such as sequences of consecutive uppercase letters" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteySysReq.ASR_PASTEY_001@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.FeatReq FEAT_PASTEY_008 { | ||
| description = "The paste! macro shall support the :replace(from, to) modifier, which shall perform string replacement on the preceding pasted value using str::replace semantics, and shall produce a compile error when more than one token is supplied for either argument, when the preceding value is absent, or when the modifier syntax is malformed" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteySysReq.ASR_PASTEY_001@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.FeatReq FEAT_PASTEY_009 { | ||
| description = "The paste! macro shall produce a raw identifier (r#ident) when the first and only prefix token inside [< ... >] is # and shall produce a compile error if # appears at any position other than the first" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteySysReq.ASR_PASTEY_001@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.FeatReq FEAT_PASTEY_010 { | ||
| description = "The paste! macro shall implicitly concatenate all argument values of #[doc = ...] attributes within a paste! invocation into a single documentation string" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteySysReq.ASR_PASTEY_001@1] | ||
| version = 1 | ||
| } | ||
|
|
||
| ScoreReq.FeatReq FEAT_PASTEY_011 { | ||
| description = "The paste! macro shall resolve env!(\"VAR_NAME\") expressions inside [< ... >] to the named environment variable value at compile time, shall replace hyphens in the resolved value with underscores, and shall produce a compile error when the named variable is not defined" | ||
| safety = ScoreReq.Asil.B | ||
| derived_from = [PasteySysReq.ASR_PASTEY_002@1] | ||
| version = 1 | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.