Skip to content

Include dotfiles when matching the .markdownlint folder

David Dieulivol requested to merge ddieulivol-fix_rules_spec_issue into master

What does this MR do and why?

Fixes https://gitlab.com/gitlab-org/gitlab/-/jobs/6265338577#L9523:

Failures:
  1) .gitlab/ci/rules.gitlab-ci.yml patterns missed matched files does not miss files to match
     Failure/Error: expect(all_files - all_matching_files.to_a).to be_empty
       expected `["doc/.markdownlint/.markdownlint-cli2.yaml"].empty?` to be truthy, got false
     # ./spec/dot_gitlab_ci/rules_spec.rb:188:in `block (4 levels) in <main>'
     # ./spec/spec_helper.rb:436:in `block (3 levels) in <top (required)>'
     # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:427:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:423:in `block (3 levels) in <top (required)>'
     # ./lib/gitlab/application_context.rb:68:in `with_raw_context'
     # ./spec/spec_helper.rb:423:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:270:in `block (2 levels) in <top (required)>'
     # ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
     # ./spec/support/fast_quarantine.rb:22:in `block (2 levels) in <main>'
     # ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <main>'
     # ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'
     # ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <main>'

Validate locally

touch doc/.markdownlint/.markdownlint-cli2.yaml
irb
irb(main):001> Dir.glob('doc/.{markdownlint,vale}/**/*').include?('doc/.markdownlint/.markdownlint-cli2.yaml')
=> false
irb(main):002> Dir.glob('doc/.{markdownlint,vale}/**/*', File::FNM_DOTMATCH).include?('doc/.markdownlint/.markdownlint-cli2.yaml')
=> true

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by David Dieulivol

Merge request reports