Skip to content

Commit 1c111fc

Browse files
authored
chore(pipelines): move example to function scope (#18132)
The example as declared in this doc block was part of the parameter, not of the function. Change to an `@example` declaration to associate the example with the right scope. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent de2369c commit 1c111fc

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

packages/@aws-cdk/pipelines/lib/codepipeline/codepipeline-source.ts

+7-15
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { FileSet, Step } from '../blueprint';
1111
import { CodePipelineActionFactoryResult, ProduceActionOptions, ICodePipelineActionFactory } from './codepipeline-action-factory';
1212

1313
/**
14-
* CodePipeline source steps
14+
* Factory for CodePipeline source steps
1515
*
1616
* This class contains a number of factory methods for the different types
1717
* of sources that CodePipeline supports.
@@ -48,14 +48,9 @@ export abstract class CodePipelineSource extends Step implements ICodePipelineAc
4848
* @param props The options, which include the key that identifies the source code file and
4949
* and how the pipeline should be triggered.
5050
*
51-
* Example:
52-
*
53-
* ```ts
51+
* @example
5452
* declare const bucket: s3.Bucket;
55-
* pipelines.CodePipelineSource.s3(bucket, {
56-
* key: 'path/to/file.zip',
57-
* });
58-
* ```
53+
* pipelines.CodePipelineSource.s3(bucket, 'path/to/file.zip');
5954
*/
6055
public static s3(bucket: IBucket, objectKey: string, props: S3SourceOptions = {}): CodePipelineSource {
6156
return new S3Source(bucket, objectKey, props);
@@ -96,12 +91,9 @@ export abstract class CodePipelineSource extends Step implements ICodePipelineAc
9691
* @param branch The branch to use.
9792
* @param props The source properties.
9893
*
99-
* Example:
100-
*
101-
* ```ts
102-
* const repository: IRepository = ...
103-
* CodePipelineSource.codeCommit(repository, 'main');
104-
* ```
94+
* @example
95+
* declare const repository: codecommit.IRepository;
96+
* pipelines.CodePipelineSource.codeCommit(repository, 'main');
10597
*/
10698
public static codeCommit(repository: codecommit.IRepository, branch: string, props: CodeCommitSourceOptions = {}): CodePipelineSource {
10799
return new CodeCommitSource(repository, branch, props);
@@ -362,4 +354,4 @@ class CodeCommitSource extends CodePipelineSource {
362354
codeBuildCloneOutput: this.props.codeBuildCloneOutput,
363355
});
364356
}
365-
}
357+
}

0 commit comments

Comments
 (0)