From 7188da14dcd283b60ccdc7b3635e33faf70b2504 Mon Sep 17 00:00:00 2001 From: Greg Cobb Date: Tue, 30 Jun 2020 10:47:58 -0700 Subject: [PATCH] Remove vendor directory - Relocate errors to their own top-level directory - This is legacy from when https://github.com/cloudfoundry-attic/errors was a submodule of CC - Vendor directory hides where error files live, especially since some editors don't index it Authored-by: Greg Cobb --- .codeclimate.yml | 2 +- .rubocop.yml | 2 +- .solargraph.yml | 2 +- {vendor/errors => errors}/v1.yml | 0 {vendor/errors => errors}/v2.yml | 0 {vendor/errors => errors}/v3.yml | 0 lib/cloud_controller/errors/details.rb | 2 +- lib/cloud_controller/errors/v3/details.rb | 2 +- spec/spec_helper.rb | 2 +- vendor/errors/README.md | 3 --- 10 files changed, 6 insertions(+), 9 deletions(-) rename {vendor/errors => errors}/v1.yml (100%) rename {vendor/errors => errors}/v2.yml (100%) rename {vendor/errors => errors}/v3.yml (100%) delete mode 100644 vendor/errors/README.md diff --git a/.codeclimate.yml b/.codeclimate.yml index 001eb43be9d..e134fd0ae13 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -43,4 +43,4 @@ ratings: - "**.sh" exclude_paths: - docs/v3/node_modules/ -- vendor/ +- errors/ diff --git a/.rubocop.yml b/.rubocop.yml index 4c3bce7c295..b4da20152d7 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -7,7 +7,7 @@ require: AllCops: TargetRubyVersion: 2.5 Exclude: - - vendor/**/* + - errors/**/* - lib/diego/bbs/models/**/* - lib/logcache/v2/**/* diff --git a/.solargraph.yml b/.solargraph.yml index d3dbbec94d1..614c220cf90 100644 --- a/.solargraph.yml +++ b/.solargraph.yml @@ -3,7 +3,7 @@ include: - "**/*.rb" exclude: - test/**/* -- vendor/**/* +- errors/**/* - ".bundle/**/*" require: [] domains: [] diff --git a/vendor/errors/v1.yml b/errors/v1.yml similarity index 100% rename from vendor/errors/v1.yml rename to errors/v1.yml diff --git a/vendor/errors/v2.yml b/errors/v2.yml similarity index 100% rename from vendor/errors/v2.yml rename to errors/v2.yml diff --git a/vendor/errors/v3.yml b/errors/v3.yml similarity index 100% rename from vendor/errors/v3.yml rename to errors/v3.yml diff --git a/lib/cloud_controller/errors/details.rb b/lib/cloud_controller/errors/details.rb index aadf0d2b1b7..9f8f9adf3b8 100644 --- a/lib/cloud_controller/errors/details.rb +++ b/lib/cloud_controller/errors/details.rb @@ -22,7 +22,7 @@ def self.load_by_name(yaml_file_path) module V2 class HardCodedDetails def self.yaml_file_path - File.join(File.expand_path('../../../vendor/errors', __dir__), 'v2.yml') + File.join(File.expand_path('../../../errors', __dir__), 'v2.yml') end HARD_CODED_DETAILS = CloudController::Errors::DetailsLoader.load_by_name(yaml_file_path) diff --git a/lib/cloud_controller/errors/v3/details.rb b/lib/cloud_controller/errors/v3/details.rb index c9f5c1096ba..a46168e33be 100644 --- a/lib/cloud_controller/errors/v3/details.rb +++ b/lib/cloud_controller/errors/v3/details.rb @@ -5,7 +5,7 @@ module Errors module V3 class HardCodedDetails def self.yaml_file_path - File.join(File.expand_path('../../../../vendor/errors', __dir__), 'v3.yml') + File.join(File.expand_path('../../../../errors', __dir__), 'v3.yml') end HARD_CODED_DETAILS = DetailsLoader.load_by_name(yaml_file_path) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 52138b42739..ca60965dcca 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -48,7 +48,7 @@ require 'simplecov' SimpleCov.start do add_filter '/spec/' - add_filter '/vendor/' + add_filter '/errors/' add_filter '/docs/' end end diff --git a/vendor/errors/README.md b/vendor/errors/README.md deleted file mode 100644 index b7f7fcb997a..00000000000 --- a/vendor/errors/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# errors - -Shared error codes and messages for Cloud Foundry