From 21076575960036236ae7ba01d0bb53b20a6feb19 Mon Sep 17 00:00:00 2001 From: Thomas Steenbergen Date: Thu, 23 Nov 2023 18:04:41 +0530 Subject: [PATCH] feat(helper-cli): Extend path exclude generator by a couple of patterns Add patterns for common CI configuration, build or test files and dirs. Signed-off-by: Thomas Steenbergen --- .../main/kotlin/utils/PathExcludeGenerator.kt | 19 +++++++++++++++++++ .../expected-directory-exclude-patterns.txt | 4 ++++ .../expected-exclude-patterns.txt | 4 ++++ .../expected-file-exclude-patterns.txt | 1 + 4 files changed, 28 insertions(+) diff --git a/helper-cli/src/main/kotlin/utils/PathExcludeGenerator.kt b/helper-cli/src/main/kotlin/utils/PathExcludeGenerator.kt index eedfd62fb2a84..34e4e05340d08 100644 --- a/helper-cli/src/main/kotlin/utils/PathExcludeGenerator.kt +++ b/helper-cli/src/main/kotlin/utils/PathExcludeGenerator.kt @@ -151,6 +151,7 @@ private val PATH_EXCLUDES_REASON_FOR_DIR_NAME = listOf( "*performance*" to BUILD_TOOL_OF, "*profiler*" to BUILD_TOOL_OF, "*test*" to TEST_OF, + ".circleci" to BUILD_TOOL_OF, ".github" to BUILD_TOOL_OF, ".gradle" to BUILD_TOOL_OF, ".idea" to BUILD_TOOL_OF, @@ -159,6 +160,7 @@ private val PATH_EXCLUDES_REASON_FOR_DIR_NAME = listOf( ".teamcity" to BUILD_TOOL_OF, ".travis" to BUILD_TOOL_OF, ".yarn" to BUILD_TOOL_OF, + "bamboo-specs" to BUILD_TOOL_OF, "bench" to TEST_OF, "benches" to TEST_OF, "benchmark" to TEST_OF, @@ -174,10 +176,13 @@ private val PATH_EXCLUDES_REASON_FOR_DIR_NAME = listOf( "doc-files" to DOCUMENTATION_OF, "docs" to DOCUMENTATION_OF, "e2e" to TEST_OF, + "fuzz" to TEST_OF, + "fuzzing" to TEST_OF, "javadoc" to DOCUMENTATION_OF, "jsdoc" to DOCUMENTATION_OF, "m4" to BUILD_TOOL_OF, "manual" to DOCUMENTATION_OF, + "perf" to TEST_OF, "scripts" to BUILD_TOOL_OF, "spec" to DOCUMENTATION_OF, "srcm4" to BUILD_TOOL_OF, @@ -203,9 +208,17 @@ private val PATH_EXCLUDE_REASON_FOR_FILENAME = listOf( "*.test.js" to TEST_OF, "*_test.go" to TEST_OF, "*coverage*.sh" to BUILD_TOOL_OF, + ".appveyor.yml" to BUILD_TOOL_OF, + ".bazelrc" to BUILD_TOOL_OF, + ".clang-format" to BUILD_TOOL_OF, + ".drone.yml" to BUILD_TOOL_OF, ".editorconfig" to PathExcludeReason.OTHER, + ".gitlab-ci.yml" to BUILD_TOOL_OF, + ".jitpack.yml" to BUILD_TOOL_OF, + ".mailmap" to PathExcludeReason.OTHER, ORT_REPO_CONFIG_FILENAME to BUILD_TOOL_OF, ".travis.yml" to BUILD_TOOL_OF, + ".zuul.yml" to BUILD_TOOL_OF, "BUILD" to BUILD_TOOL_OF, // Bazel "Build.PL" to BUILD_TOOL_OF, "CHANGELOG*" to BUILD_TOOL_OF, @@ -236,6 +249,8 @@ private val PATH_EXCLUDE_REASON_FOR_FILENAME = listOf( "RELEASE-NOTES*" to DOCUMENTATION_OF, "Rakefile*" to BUILD_TOOL_OF, "SECURITY.md" to DOCUMENTATION_OF, + "azure-pipelines.yml" to BUILD_TOOL_OF, + "bitbucket-pipelines.yml" to BUILD_TOOL_OF, "build" to BUILD_TOOL_OF, "build*.sh" to BUILD_TOOL_OF, "build.bat" to BUILD_TOOL_OF, @@ -245,7 +260,10 @@ private val PATH_EXCLUDE_REASON_FOR_FILENAME = listOf( "build.sbt" to BUILD_TOOL_OF, "changelog*" to BUILD_TOOL_OF, "checksrc.bat" to BUILD_TOOL_OF, + "codecov.yml" to BUILD_TOOL_OF, "codenarc.groovy" to BUILD_TOOL_OF, + "codeship-services.yml" to BUILD_TOOL_OF, + "codeship-steps.yml" to BUILD_TOOL_OF, "compile" to BUILD_TOOL_OF, "conanfile.py" to BUILD_TOOL_OF, "config.guess" to BUILD_TOOL_OF, @@ -264,6 +282,7 @@ private val PATH_EXCLUDE_REASON_FOR_FILENAME = listOf( "mkdocs.yml" to BUILD_TOOL_OF, "package-lock.json" to BUILD_TOOL_OF, "proguard-rules.pro" to BUILD_TOOL_OF, + "renovate.json" to BUILD_TOOL_OF, "runsuite.c" to TEST_OF, "runtest.c" to TEST_OF, "settings.gradle" to BUILD_TOOL_OF, diff --git a/helper-cli/src/test/assets/path-exclude-gen/expected-directory-exclude-patterns.txt b/helper-cli/src/test/assets/path-exclude-gen/expected-directory-exclude-patterns.txt index 7a3aa01535e89..83183fc392dd0 100644 --- a/helper-cli/src/test/assets/path-exclude-gen/expected-directory-exclude-patterns.txt +++ b/helper-cli/src/test/assets/path-exclude-gen/expected-directory-exclude-patterns.txt @@ -242,6 +242,7 @@ formats/protobuf/jvmTest/** formats/protobuf/nativeTest/** fragment/tests/** framework-test/** +fuzz/** generator/graphql-kotlin-federation/src/test/** generator/graphql-kotlin-schema-generator/src/test/** generators/analysis-api-generator/tests/** @@ -706,6 +707,7 @@ packages/create-react-app/__tests__/** packages/create-subscription/src/__tests__/** packages/cssnano-preset-advanced/src/__tests__/** packages/cssnano-preset-default/src/__tests__/** +packages/diff-sequences/perf/** packages/diff-sequences/src/__tests__/** packages/dom-event-testing-library/** packages/eslint-plugin-react-hooks/__tests__/** @@ -765,6 +767,7 @@ packages/jest-worker/src/__tests__/** packages/jest-worker/src/base/__tests__/** packages/jest-worker/src/workers/__tests__/** packages/legacy-events/__tests__/** +packages/pretty-format/perf/** packages/pretty-format/src/__tests__/** packages/react-art/src/__tests__/** packages/react-cache/src/__tests__/** @@ -812,6 +815,7 @@ paging/common/src/test/** paging/integration-tests/** paging/runtime/src/androidTest/** percent/tests/** +perf/** pgjdbc-osgi-test/** pgjdbc/src/test/** platform-tests/** diff --git a/helper-cli/src/test/assets/path-exclude-gen/expected-exclude-patterns.txt b/helper-cli/src/test/assets/path-exclude-gen/expected-exclude-patterns.txt index ca3f6c9b936e7..62fd2f30fff8c 100644 --- a/helper-cli/src/test/assets/path-exclude-gen/expected-exclude-patterns.txt +++ b/helper-cli/src/test/assets/path-exclude-gen/expected-exclude-patterns.txt @@ -68,11 +68,14 @@ curl-7.79.1/packages/OS400/make-tests.sh curl-7.79.1/projects/checksrc.bat dataflow/manual/** e2e/** +fuzz/** googlemock/** gradlew.bat +icu4c/source/.clang-format jitpack.yml lib/rspec/core/mocking_adapters/** libiconv-1.17/srcm4/** +libxml2-2.9.14/fuzz/** libxml2-2.9.14/runsuite.c libxml2-2.9.14/runtest.c maven-resolver-demos/** @@ -81,6 +84,7 @@ native/libffi/libtool-ldflags objectivec/DevTools/** org.abego.treelayout.demo/** package-lock.json +perf/** runtime/Perl5/Build.PL samples/SupportLeanbackDemos/** setup.cfg diff --git a/helper-cli/src/test/assets/path-exclude-gen/expected-file-exclude-patterns.txt b/helper-cli/src/test/assets/path-exclude-gen/expected-file-exclude-patterns.txt index 2affcf91fbf35..1b74fa9336d66 100644 --- a/helper-cli/src/test/assets/path-exclude-gen/expected-file-exclude-patterns.txt +++ b/helper-cli/src/test/assets/path-exclude-gen/expected-file-exclude-patterns.txt @@ -60,6 +60,7 @@ curl-7.79.1/ltmain.sh curl-7.79.1/packages/OS400/make-tests.sh curl-7.79.1/projects/checksrc.bat gradlew.bat +icu4c/source/.clang-format jitpack.yml libxml2-2.9.14/runsuite.c libxml2-2.9.14/runtest.c