Skip to content

Commit

Permalink
Fail Rubocop on warn logging (#11458)
Browse files Browse the repository at this point in the history
* Fail Rubocop on warn logging

changelog: Internal, Automated Testing, Fail static analysis linting when warning messages emitted

* Try output parsing for Rubocop namespace warning

* Make tmp dir before writing Rubocop results

Doesn't exist by default at this point in CI

* Reroute stderr to tmp file

* Use correct namespace for LineLength cop
  • Loading branch information
aduth authored Nov 8, 2024
1 parent 24bd868 commit 22e2ab2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,13 @@ lint: ## Runs all lint tests
@echo "--- erb-lint ---"
make lint_erb
@echo "--- rubocop ---"
mkdir -p tmp
ifdef JUNIT_OUTPUT
bundle exec rubocop --parallel --format progress --format junit --out rubocop.xml --display-only-failed
bundle exec rubocop --parallel --format progress --format junit --out rubocop.xml --display-only-failed --color 2> tmp/rubocop.txt
else
bundle exec rubocop --parallel
bundle exec rubocop --parallel --color 2> tmp/rubocop.txt
endif
awk 'NF {exit 1}' tmp/rubocop.txt || (printf "Error: Unexpected stderr output from Rubocop\n"; cat tmp/rubocop.txt; exit 1)
@echo "--- analytics_events ---"
make lint_analytics_events
make lint_analytics_events_sorted
Expand Down
4 changes: 2 additions & 2 deletions lib/identity_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def self.store

# identity-hostdata transforms these configs to the described type
# rubocop:disable Metrics/BlockLength
# rubocop:disable Metrics/LineLength
# rubocop:disable Layout/LineLength
BUILDER = proc do |config|
# ______________________________________
# / Adding something new in here? Please \
Expand Down Expand Up @@ -472,6 +472,6 @@ def self.store
config.add(:vtm_url)
config.add(:weekly_auth_funnel_report_config, type: :json)
end.freeze
# rubocop:enable Metrics/LineLength
# rubocop:enable Layout/LineLength
# rubocop:enable Metrics/BlockLength
end

0 comments on commit 22e2ab2

Please sign in to comment.