Skip to content
This repository was archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Ignore the codepipeline file. (#64)
Browse files Browse the repository at this point in the history
It's only an alias, and we generate an empty file.

Signed-off-by: David Calavera <david.calavera@gmail.com>
  • Loading branch information
calavera authored Feb 16, 2022
1 parent 24e8d40 commit 7bccd97
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion aws_lambda_events/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ ses = []
sns = []
sqs = []
streams = []
generated = ["activemq", "appsync", "autoscaling", "chime_bot", "clientvpn", "cloudwatch_logs", "code_commit", "codebuild", "codedeploy", "codepipeline", "codepipeline_cloudwatch", "codepipeline_job", "cognito", "config", "connect", "ecr_scan", "firehose", "iot", "iot_1_click", "iot_button", "kafka", "kinesis", "kinesis_analytics", "lex", "rabbitmq", "s3", "s3_batch_job", "ses", "sns", "sqs", "streams"]
generated = ["activemq", "appsync", "autoscaling", "chime_bot", "clientvpn", "cloudwatch_logs", "code_commit", "codebuild", "codedeploy", "codepipeline_cloudwatch", "codepipeline_job", "cognito", "config", "connect", "ecr_scan", "firehose", "iot", "iot_1_click", "iot_button", "kafka", "kinesis", "kinesis_analytics", "lex", "rabbitmq", "s3", "s3_batch_job", "ses", "sns", "sqs", "streams"]
1 change: 0 additions & 1 deletion aws_lambda_events/src/generated/codepipeline.rs

This file was deleted.

3 changes: 0 additions & 3 deletions aws_lambda_events/src/generated/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ pub mod codebuild;
/// AWS Lambda event definitions for codedeploy.
#[cfg(feature = "codedeploy")]
pub mod codedeploy;
/// AWS Lambda event definitions for codepipeline.
#[cfg(feature = "codepipeline")]
pub mod codepipeline;
/// AWS Lambda event definitions for codepipeline_cloudwatch.
#[cfg(feature = "codepipeline_cloudwatch")]
pub mod codepipeline_cloudwatch;
Expand Down
28 changes: 15 additions & 13 deletions aws_lambda_events_codegen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,27 @@ struct Cli {
verbosity: u8,
}

fn get_blacklist() -> HashSet<String> {
let mut blacklist = HashSet::new();
fn get_ignorelist() -> HashSet<String> {
let mut ignore = HashSet::new();
// ApiGW events are fully implemented statically
blacklist.insert("apigw".to_string());
ignore.insert("apigw".to_string());
// ALB events are fully implemented statically
blacklist.insert("alb".to_string());
ignore.insert("alb".to_string());
// https://github.com/aws/aws-lambda-go/blob/master/events/attributevalue.go
blacklist.insert("attributevalue".to_string());
ignore.insert("attributevalue".to_string());
// codepipeline is just an alias for codepipeline_job
ignore.insert("codepipeline".to_string());
// https://github.com/aws/aws-lambda-go/blob/master/events/duration.go
blacklist.insert("duration".to_string());
ignore.insert("duration".to_string());
// https://github.com/aws/aws-lambda-go/blob/master/events/dynamodb.go
// DynamoDB events are fully implemented statically
blacklist.insert("dynamodb".to_string());
ignore.insert("dynamodb".to_string());
// https://github.com/aws/aws-lambda-go/blob/master/events/epoch_time.go
blacklist.insert("epoch_time".to_string());
ignore.insert("epoch_time".to_string());
// Cloudwatch Events are fully implemented statically
blacklist.insert("cloudwatch_events".to_string());
ignore.insert("cloudwatch_events".to_string());

blacklist
ignore
}

fn overwrite_warning(path: &Path, overwrite: bool) -> Option<()> {
Expand Down Expand Up @@ -567,7 +569,7 @@ main!(|args: Cli, log_level: verbosity| {
let pattern = format!("{}/events/*.go", args.sdk_location.to_string_lossy());

// Some files we don't properly handle yet.
let blacklist = get_blacklist();
let ignore = get_ignorelist();

let example_event_path = args.sdk_location.join("events/testdata");
let fuzzy_example_events = get_fuzzy_file_listing(&example_event_path)?;
Expand All @@ -577,8 +579,8 @@ main!(|args: Cli, log_level: verbosity| {
let x = path.clone();
let file_name = x.file_stem().expect("file stem").to_string_lossy();

// Filter out tests and blacklisted files.
if !file_name.contains("_test") && !blacklist.contains(&*file_name) {
// Filter out tests and ignore files.
if !file_name.contains("_test") && !ignore.contains(&*file_name) {
// Parse the code.
info!("Parsing: {}", x.to_string_lossy());
let (go, rust) = go_to_rust::parse_go_file(&path)?;
Expand Down

0 comments on commit 7bccd97

Please # to comment.