Skip to content

Commit

Permalink
refactor: import functions directly
Browse files Browse the repository at this point in the history
let's see if sonar is happy now
  • Loading branch information
aripalo committed Nov 22, 2024
1 parent c7867c2 commit 23bff46
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/project/deprecation-warnings.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
import { Annotations } from "aws-cdk-lib";
import { Construct } from "constructs";
import * as featureFlags from "../feature-flags";
import {
useLegacyTags,
useCompatibilityV0Tags,
LEGACY_TAGS_CONTEXT_KEY,
V0_TAGS_CONTEXT_KEY,
} from "../feature-flags";

export function warnAboutDeprecatedTags(scope: Construct) {
if (featureFlags.useLegacyTags(scope)) {
if (useLegacyTags(scope)) {
Annotations.of(scope).addWarningV2(
"@alma-cdk/project@v1:legacy-tags",
`Using @almamedia-cdk/tag-and-name (for AWS CDK v1) construct's legacy tagging behavior via "${featureFlags.LEGACY_TAGS_CONTEXT_KEY}" context key. This is not encouraged and will be removed in v2.`,
`Using @almamedia-cdk/tag-and-name (for AWS CDK v1) construct's legacy tagging behavior via "${LEGACY_TAGS_CONTEXT_KEY}" context key. This is not encouraged and will be removed in v2.`,
);
}

if (featureFlags.useCompatibilityV0Tags(scope)) {
if (useCompatibilityV0Tags(scope)) {
Annotations.of(scope).addWarningV2(
"@alma-cdk/project@v1:compatibility-v0-tags",
`Using @alma-cdk/project@v0 construct's tagging behavior via "${featureFlags.V0_TAGS_CONTEXT_KEY}" context key. You should migrate to using the default tagging behavior as this feature flag will be removed in v2.`,
`Using @alma-cdk/project@v0 construct's tagging behavior via "${V0_TAGS_CONTEXT_KEY}" context key. You should migrate to using the default tagging behavior as this feature flag will be removed in v2.`,
);
}
}

0 comments on commit 23bff46

Please sign in to comment.