<NME> README.md
<BEF> # Rusoto Service Crate Generator
This executable generates crates for AWS services based on their botocore service manifests.

## Usage
In order to run the service generator, first make sure that the botocore submodule has been initialized:

```bash
$ git submodule update --init
```

The service generator uses the `stable` version of `rustfmt` to format the generated code nicely.

Install the `rustfmt` component via `rustup`:

```bash
$ rustup component add --toolchain stable rustfmt-preview
```

From the `service_crategen` directory, call:

```bash
$ cargo +stable run -- generate -c ./services.json -o ../rusoto/services
```

This will regenerate all services in the `rusoto/services` directory, updating them with the configuration defined in the `services.json` file and applying any code generation changes.

It is also possible to limit the set of services generated by the generator. For example, to only generate the s3 and ec2 crates,
run the following:

```bash
$ cargo +stable run -- generate -c ./services.json -o ../rusoto/services -s s3 -s ec2
    Finished dev [optimized] target(s) in 0.35s
    Running `target/debug/rusoto_service_crategen generate -c ./services.json -o ../rusoto/services -s s3 -s ec2`
Generating crate for Amazon Simple Storage Service @ 2006-03-01...
Generating crate for Amazon Elastic Compute Cloud @ 2016-11-15...
```


## Customizing Generated Crates
Some service crates may require customized code, perhaps as helper code to make it easier to use for end-users or custom tests. Since services are regenerated by the generator, there needs to be a safe place for custom code to sit that won't be destroyed on regeneration.

Every crate is generated with a `custom` module inside. This module is empty by default, but anything can be added to the `custom` directory and module after generation and it will not be deleted on regeneration. This does mean, however, that care must be taken to verify that custom code still builds and works on regenerated crates, so it should be well-tested and kept up-to-date.

## Testing Generated Crates
After regenerating, all crates should be tested to verify that they still build and their tests pass. This is a fairly simple process. From the `rusoto` directory, run:

```bash
$ cargo +stable test --all --lib
```

This will tests service crates, in addition to the `rusoto_core` crate.

### Accommodating type name conflicts

At times you will find that botocore definition will define a shape Rusoto translates
into a struct whose name conflicts with the name Rusoto sythesizes for error type enum for operations.
In those cases, the common approach to accommodate these collisions is to customize
the name of the error enum rusoto generates. Do this in `service_codegen/src/commands/generate/codgen/mod.rs` in the `mutate_type_name` method.

## Checking Services (Missing & Outdated)
The crate generator is also able to check for any missing or outdated services with the `check` command:

```bash
$ cargo +stable run -- check -c ./services.json
```

If there are any missing or outdated services, they will be output in a formatted list along with useful information.

## Crate generation timing

To output timing information on crate generation, run with logging set to debug level:

```bash
$ RUST_LOG=rusoto_service_crategen=debug cargo +stable run -- generate -c ./services.json -o ../rusoto/services
```

<MSG> update install note for rustfmt and link to rustfmt docs

<DFF> @@ -8,12 +8,12 @@ In order to run the service generator, first make sure that the botocore submodu
 $ git submodule update --init
 ```
 
-The service generator uses the `stable` version of `rustfmt` to format the generated code nicely.
+The service generator uses the `stable` version of [`rustfmt`](https://github.com/rust-lang/rustfmt) to format the generated code nicely.
 
 Install the `rustfmt` component via `rustup`:
 
 ```bash
-$ rustup component add --toolchain stable rustfmt-preview
+$ rustup component add --toolchain stable rustfmt
 ```
 
 From the `service_crategen` directory, call:

{'commit': 'diff --git a/service_crategen/README.md b/service_crategen/README.md\nindex 26f603ba8..11f8ea91e 100644\n--- a/service_crategen/README.md\n+++ b/service_crategen/README.md\n@@ -8,12 +8,12 @@ In order to run the service generator, first make sure that the botocore submodu\n $ git submodule update --init\n ```\n \n-The service generator uses the `stable` version of `rustfmt` to format the generated code nicely.\n+The service generator uses the `stable` version of [`rustfmt`](https://github.com/rust-lang/rustfmt) to format the generated code nicely.\n \n Install the `rustfmt` component via `rustup`:\n \n ```bash\n-$ rustup component add --toolchain stable rustfmt-preview\n+$ rustup component add --toolchain stable rustfmt\n ```\n \n From the `service_crategen` directory, call:\n', 'commit_subject': 'update install note for rustfmt and link to rustfmt docs', 'repo_name': 'rusoto/rusoto', 'committer': {'name': 'softprops', 'email': '20acf1ed233696a8e28253cc68d54bfc4f488dca@gmail.com', 'time_sec': '1550813253', 'tz_offset': '-300', 'date': {'seconds': '1550813253'}}, 'commit_tree': '6012800ac5b54a6a1a8a3c2a9c8c22e4f1a8cb3a', 'commit_message': 'update install note for rustfmt and link to rustfmt docs\n', 'language_name': 'Rust', 'license': 'mit', 'hunks': '@@ -8,12 +8,12 @@ In order to run the service generator, first make sure that the botocore submodu\n $ git submodule update --init\n ```\n \n-The service generator uses the `stable` version of `rustfmt` to format the generated code nicely.\n+The service generator uses the `stable` version of [`rustfmt`](https://github.com/rust-lang/rustfmt) to format the generated code nicely.\n \n Install the `rustfmt` component via `rustup`:\n \n ```bash\n-$ rustup component add --toolchain stable rustfmt-preview\n+$ rustup component add --toolchain stable rustfmt\n ```\n \n From the `service_crategen` directory, call:\n', 'addition_count': 2, 'deletion_count': 2, 'src_file': 'a/service_crategen/README.md', 'tgt_file': 'b/service_crategen/README.md', 'file_extension': '.md', 'before_file': "# Rusoto Service Crate Generator\nThis executable generates crates for AWS services based on their botocore service manifests.\n\n## Usage\nIn order to run the service generator, first make sure that the botocore submodule has been initialized:\n\n```bash\n$ git submodule update --init\n```\n\nThe service generator uses the `stable` version of `rustfmt` to format the generated code nicely.\n\nInstall the `rustfmt` component via `rustup`:\n\n```bash\n$ rustup component add --toolchain stable rustfmt-preview\n```\n\nFrom the `service_crategen` directory, call:\n\n```bash\n$ cargo +stable run -- generate -c ./services.json -o ../rusoto/services\n```\n\nThis will regenerate all services in the `rusoto/services` directory, updating them with the configuration defined in the `services.json` file and applying any code generation changes.\n\nIt is also possible to limit the set of services generated by the generator. For example, to only generate the s3 and ec2 crates,\nrun the following:\n\n```bash\n$ cargo +stable run -- generate -c ./services.json -o ../rusoto/services -s s3 -s ec2\n    Finished dev [optimized] target(s) in 0.35s\n    Running `target/debug/rusoto_service_crategen generate -c ./services.json -o ../rusoto/services -s s3 -s ec2`\nGenerating crate for Amazon Simple Storage Service @ 2006-03-01...\nGenerating crate for Amazon Elastic Compute Cloud @ 2016-11-15...\n```\n\n\n## Customizing Generated Crates\nSome service crates may require customized code, perhaps as helper code to make it easier to use for end-users or custom tests. Since services are regenerated by the generator, there needs to be a safe place for custom code to sit that won't be destroyed on regeneration.\n\nEvery crate is generated with a `custom` module inside. This module is empty by default, but anything can be added to the `custom` directory and module after generation and it will not be deleted on regeneration. This does mean, however, that care must be taken to verify that custom code still builds and works on regenerated crates, so it should be well-tested and kept up-to-date.\n\n## Testing Generated Crates\nAfter regenerating, all crates should be tested to verify that they still build and their tests pass. This is a fairly simple process. From the `rusoto` directory, run:\n\n```bash\n$ cargo +stable test --all --lib\n```\n\nThis will tests service crates, in addition to the `rusoto_core` crate.\n\n### Accommodating type name conflicts\n\nAt times you will find that botocore definition will define a shape Rusoto translates\ninto a struct whose name conflicts with the name Rusoto sythesizes for error type enum for operations.\nIn those cases, the common approach to accommodate these collisions is to customize\nthe name of the error enum rusoto generates. Do this in `service_codegen/src/commands/generate/codgen/mod.rs` in the `mutate_type_name` method.\n\n## Checking Services (Missing & Outdated)\nThe crate generator is also able to check for any missing or outdated services with the `check` command:\n\n```bash\n$ cargo +stable run -- check -c ./services.json\n```\n\nIf there are any missing or outdated services, they will be output in a formatted list along with useful information.\n\n## Crate generation timing\n\nTo output timing information on crate generation, run with logging set to debug level:\n\n```bash\n$ RUST_LOG=rusoto_service_crategen=debug cargo +stable run -- generate -c ./services.json -o ../rusoto/services\n```\n", 'message': 'update install note for rustfmt and link to rustfmt docs\n', 'author_name': 'softprops', 'lang': 'md'}