From 20bacaebb124764f73a96c5426f7396672251e3c Mon Sep 17 00:00:00 2001 From: Stephen Wakely Date: Fri, 10 Nov 2023 14:38:24 +0000 Subject: [PATCH 1/6] Add other CI jobs to CONTRIBUTING.md Signed-off-by: Stephen Wakely --- CONTRIBUTING.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fe68054dd30dc..d462d172eacb3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -221,6 +221,23 @@ Integration tests are not run by default when running `cargo vdev test`. Instead, they are accessible via the integration subcommand (example: `cargo vdev int test aws` runs aws-related integration tests). You can find the list of available integration tests using `cargo vdev int show`. Integration tests require docker or podman to run. +### Running other checks + +There are other checks that are run by CI before the PR can be merged. These should be run locally +first to ensure they pass. + +- `cargo vdev check rust` - this runs the Clippy linter to catch common mistakes. +- `cargo vdev check fmt` - this ensures all code is properly formatted. Code can be run through +[`rustfmt`][urls.rustfmt] to ensure it is properly formatted. Most editors can be configured to +do this for you - highly recommended. +- `cargo vdev check events` - this ensures the internal metrics that Vector emits conform to standards. +- `cargo vdev check licenses` - ensures the `LICENSE-3rdparty.csv` file is up to date with the licenses +each of Vector's dependencies are published under. If this file needs updating, you can run +- `make check-component-docs` - Vector's documentation for each component is generated from the comments +attached to the Component structs and members. Running this ensures that the generated docs are up to +date. +- `cd rust-doc && make docs` - generates the code documentation for the Vector project. Run this to +ensure the docs can be generated without errors (warnings are acceptable at the minute). ### Deprecations @@ -266,3 +283,4 @@ This is covered by the CLA. [urls.new_issue]: https://github.com/vectordotdev/vector/issues/new [urls.submit_pr]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork [urls.vector_test_harness]: https://github.com/vectordotdev/vector-test-harness/ +[urls.rustfmt]: https://github.com/rust-lang/rustfmt \ No newline at end of file From 4ec0bb10b32a4b73d0f2799b13c66fcb6f7c07dd Mon Sep 17 00:00:00 2001 From: Stephen Wakely Date: Fri, 10 Nov 2023 14:42:50 +0000 Subject: [PATCH 2/6] Mention cargo fmt Signed-off-by: Stephen Wakely --- CONTRIBUTING.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d462d172eacb3..87a367a937a63 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -228,8 +228,7 @@ first to ensure they pass. - `cargo vdev check rust` - this runs the Clippy linter to catch common mistakes. - `cargo vdev check fmt` - this ensures all code is properly formatted. Code can be run through -[`rustfmt`][urls.rustfmt] to ensure it is properly formatted. Most editors can be configured to -do this for you - highly recommended. +[`rustfmt`][urls.rustfmt] using `cargo fmt` to ensure it is properly formatted. - `cargo vdev check events` - this ensures the internal metrics that Vector emits conform to standards. - `cargo vdev check licenses` - ensures the `LICENSE-3rdparty.csv` file is up to date with the licenses each of Vector's dependencies are published under. If this file needs updating, you can run From 6831e7f00fcf252ceabf252c8f161d2e30fafef7 Mon Sep 17 00:00:00 2001 From: Stephen Wakely Date: Fri, 10 Nov 2023 14:53:12 +0000 Subject: [PATCH 3/6] Link to clippy Signed-off-by: Stephen Wakely --- CONTRIBUTING.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 87a367a937a63..2a63e49936504 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -226,7 +226,7 @@ Integration tests are not run by default when running There are other checks that are run by CI before the PR can be merged. These should be run locally first to ensure they pass. -- `cargo vdev check rust` - this runs the Clippy linter to catch common mistakes. +- `cargo vdev check rust` - this runs the [Clippy][urls.clippy] linter to catch common mistakes. - `cargo vdev check fmt` - this ensures all code is properly formatted. Code can be run through [`rustfmt`][urls.rustfmt] using `cargo fmt` to ensure it is properly formatted. - `cargo vdev check events` - this ensures the internal metrics that Vector emits conform to standards. @@ -282,4 +282,5 @@ This is covered by the CLA. [urls.new_issue]: https://github.com/vectordotdev/vector/issues/new [urls.submit_pr]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork [urls.vector_test_harness]: https://github.com/vectordotdev/vector-test-harness/ -[urls.rustfmt]: https://github.com/rust-lang/rustfmt \ No newline at end of file +[urls.clippy]: https://github.com/rust-lang/rust-clippy +[urls.rustfmt]: https://github.com/rust-lang/rustfmt From f89fe4b8b98c678edd4c68504904813a23b4f1c3 Mon Sep 17 00:00:00 2001 From: Stephen Wakely Date: Fri, 10 Nov 2023 15:03:57 +0000 Subject: [PATCH 4/6] Make checks copy pasteable Signed-off-by: Stephen Wakely --- CONTRIBUTING.md | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2a63e49936504..97b38318463ce 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -226,17 +226,14 @@ Integration tests are not run by default when running There are other checks that are run by CI before the PR can be merged. These should be run locally first to ensure they pass. -- `cargo vdev check rust` - this runs the [Clippy][urls.clippy] linter to catch common mistakes. -- `cargo vdev check fmt` - this ensures all code is properly formatted. Code can be run through -[`rustfmt`][urls.rustfmt] using `cargo fmt` to ensure it is properly formatted. -- `cargo vdev check events` - this ensures the internal metrics that Vector emits conform to standards. -- `cargo vdev check licenses` - ensures the `LICENSE-3rdparty.csv` file is up to date with the licenses -each of Vector's dependencies are published under. If this file needs updating, you can run -- `make check-component-docs` - Vector's documentation for each component is generated from the comments -attached to the Component structs and members. Running this ensures that the generated docs are up to -date. -- `cd rust-doc && make docs` - generates the code documentation for the Vector project. Run this to -ensure the docs can be generated without errors (warnings are acceptable at the minute). +```sh +cargo vdev check rust # this runs the [Clippy][urls.clippy] linter to catch common mistakes. +cargo vdev check fmt # this ensures all code is properly formatted. Code can be run through [`rustfmt`][urls.rustfmt] using `cargo fmt` to ensure it is properly formatted. +cargo vdev check events # this ensures the internal metrics that Vector emits conform to standards. +cargo vdev check licenses # ensures the `LICENSE-3rdparty.csv` file is up to date with the licenses each of Vector's dependencies are published under. +make check-component-docs # Vector's documentation for each component is generated from the comments attached to the Component structs and members. Running this ensures that the generated docs are up to date. +cd rust-doc && make docs # generates the code documentation for the Vector project. Run this to ensure the docs can be generated without errors (warnings are acceptable at the minute). +``` ### Deprecations From 3639edc5c2d222408363de916e01de9a855e5c9c Mon Sep 17 00:00:00 2001 From: Stephen Wakely Date: Fri, 10 Nov 2023 15:07:03 +0000 Subject: [PATCH 5/6] Reduce line length Signed-off-by: Stephen Wakely --- CONTRIBUTING.md | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 97b38318463ce..e9c42dc3de0e6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -227,12 +227,20 @@ There are other checks that are run by CI before the PR can be merged. These sho first to ensure they pass. ```sh -cargo vdev check rust # this runs the [Clippy][urls.clippy] linter to catch common mistakes. -cargo vdev check fmt # this ensures all code is properly formatted. Code can be run through [`rustfmt`][urls.rustfmt] using `cargo fmt` to ensure it is properly formatted. -cargo vdev check events # this ensures the internal metrics that Vector emits conform to standards. -cargo vdev check licenses # ensures the `LICENSE-3rdparty.csv` file is up to date with the licenses each of Vector's dependencies are published under. -make check-component-docs # Vector's documentation for each component is generated from the comments attached to the Component structs and members. Running this ensures that the generated docs are up to date. -cd rust-doc && make docs # generates the code documentation for the Vector project. Run this to ensure the docs can be generated without errors (warnings are acceptable at the minute). +# Run the [Clippy][urls.clippy] linter to catch common mistakes. +cargo vdev check rust +# Ensure all code is properly formatted. Code can be run through [`rustfmt`][urls.rustfmt] using `cargo fmt` to ensure it is properly formatted. +cargo vdev check fmt +# Ensure the internal metrics that Vector emits conform to standards. +cargo vdev check events +# Ensure the `LICENSE-3rdparty.csv` file is up to date with the licenses each of Vector's dependencies are published under. +cargo vdev check licenses +# Vector's documentation for each component is generated from the comments attached to the Component structs and members. +# Running this ensures that the generated docs are up to date. +make check-component-docs +# Generate the code documentation for the Vector project. +# Run this to ensure the docs can be generated without errors (warnings are acceptable at the minute). +cd rust-doc && make docs ``` ### Deprecations From 2f5155ecdfd85d4a5365f6d302bb86a962622538 Mon Sep 17 00:00:00 2001 From: Stephen Wakely Date: Fri, 10 Nov 2023 15:08:35 +0000 Subject: [PATCH 6/6] Remove urls Signed-off-by: Stephen Wakely --- CONTRIBUTING.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e9c42dc3de0e6..ab1255a76fa9e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -227,9 +227,9 @@ There are other checks that are run by CI before the PR can be merged. These sho first to ensure they pass. ```sh -# Run the [Clippy][urls.clippy] linter to catch common mistakes. +# Run the Clippy linter to catch common mistakes. cargo vdev check rust -# Ensure all code is properly formatted. Code can be run through [`rustfmt`][urls.rustfmt] using `cargo fmt` to ensure it is properly formatted. +# Ensure all code is properly formatted. Code can be run through `rustfmt` using `cargo fmt` to ensure it is properly formatted. cargo vdev check fmt # Ensure the internal metrics that Vector emits conform to standards. cargo vdev check events @@ -287,5 +287,3 @@ This is covered by the CLA. [urls.new_issue]: https://github.com/vectordotdev/vector/issues/new [urls.submit_pr]: https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork [urls.vector_test_harness]: https://github.com/vectordotdev/vector-test-harness/ -[urls.clippy]: https://github.com/rust-lang/rust-clippy -[urls.rustfmt]: https://github.com/rust-lang/rustfmt