Skip to content
代码片段 群组 项目
该项目从 https://gitlab.com/gitlab-org/gitlab.git 镜像。 拉取镜像更新于
  1. 7月 24, 2024
  2. 7月 17, 2024
  3. 7月 16, 2024
  4. 7月 12, 2024
  5. 7月 11, 2024
  6. 7月 09, 2024
  7. 7月 04, 2024
  8. 7月 03, 2024
    • Abdul Wadood's avatar
      Add a keep to generate rubocop todo files · 3ec51a15
      Abdul Wadood 创作于
      We're using the housekeeper gem here to generate the `.rubocop_todo`
      files and create an MR.
      
      Run `bundle exec gitlab-housekeeper -d -k Keeps::GenerateRubocopTodos`
      to test out the changes locally.
      3ec51a15
  9. 6月 12, 2024
    • Abdul Wadood's avatar
      Fix undefined method error when exclusion list is empty · 5a3241ab
      Abdul Wadood 创作于
      When the `Exclude` todo list for a cop is empty the following error was
      thrown:
      
      ```
      undefined method `grep' for nil:NilClass
      gitlab/rubocop/formatter/todo_formatter.rb:95:in `block in create_todos_retaining_exclusions'
      ```
      
      Because here the `Exclude` key is mapped to `nil` and therefore the
      default of `[]` isn't returned by the `fetch` method.
      
      To reproduce the issue on the master branch create this file
      `.rubocop_todo/migration/avoid_finalize_background_migration.yml` with
      the following contents:
      
      ```yml
      ---
      Migration/AvoidFinalizeBackgroundMigration:
        Exclude:
      ```
      
      Then run `bundle exec rake rubocop:todo:generate`, the above error will
      be thrown.
      
      On this branch, the error will not be thrown and the same has been
      covered in the specs.
      5a3241ab
    • Nick Malcolm's avatar
      Use the `RESTRICT_ON_SEND` optimization and remove special cases · 9bdcaa1a
      Nick Malcolm 创作于
      Instead of using a double negative @splattael suggested matching on
      all params, ehn permitting when params is used safely.
      
      With that we could simplify the node pattern while making the cop rule
      faster and perhaps more secure. There's no special case made for methods
      like page, per, puts, has_key, etc.
      
      The downside is the number of rubocop exceptions when from 225 to 379.
      9bdcaa1a
  10. 6月 07, 2024
  11. 6月 06, 2024
  12. 6月 04, 2024
  13. 5月 31, 2024
  14. 5月 22, 2024
  15. 5月 18, 2024
  16. 5月 15, 2024
  17. 5月 12, 2024
  18. 5月 04, 2024
  19. 5月 01, 2024
  20. 4月 17, 2024
  21. 4月 09, 2024
  22. 4月 08, 2024
    • Peter Leitzen's avatar
      RSpec/HaveGitlabHttpStatus: Avoid infinite correction loop · 5ee5db48
      Peter Leitzen 创作于
      In case of `have_gitlab_http_status(-1)` we've seen an
      `RuboCop::Runner::InfiniteCorrectionLoop` error after upgrading RuboCop.
      
      This commits side-steps this problem by checking if replacement is not
      identical to the previous source version.
      5ee5db48
  23. 4月 03, 2024
    • Peter Leitzen's avatar
      Skip Migration/EnsureFactoryForTable in CE · 2bd4e811
      Peter Leitzen 创作于
      Since migrations for EE models don't have factories in CE we need to
      skip this cop in foss-only CI.
      
      This commit also simplifies the implementation and improves the
      performances be caching files operations.
      2bd4e811
  24. 3月 28, 2024
  25. 3月 25, 2024
  26. 3月 22, 2024
  27. 3月 14, 2024
    • Peter Leitzen's avatar
      Add new cop Gitlab/Rails/SafeFormat · 99e2f6fe
      Peter Leitzen 创作于
      Enforce `safe_format` for externalized strings with interpolations and
      `.html_safe`.
      
        # bad
        _('string %{open}foo%{close}').html_safe % { open: '<b>'.html_safe, close: '</b>'.html_safe }
        format(_('string %{open}foo%{close}').html_safe, open: '<b>'.html_safe, close: '</b>'.html_safe)
      
        # good
        safe_format(_('string %{open}foo%{close}'), tag_pair(tag.b, :open, :close)
        # also good no `html_safe`
        format(_('string %{var} number'), var: var)
      99e2f6fe
  28. 3月 06, 2024
  29. 3月 05, 2024
  30. 2月 28, 2024
    • Doug Stull's avatar
      Discourage use of Current.organization outside of approved app layers · 3e3e7e34
      Doug Stull 创作于
      - add rubocop to lint on use of Current.organization outside
        of approved app layers.
      - see https://gitlab.com/gitlab-org/gitlab/-/issues/442751 for
        details
      
      ```
            # # bad
            # class SomeService
            #   def execute
            #     do_something_with(Current.organization)
            #   end
            # end
            #
            # # good
            # class SomeController < ApplicationController
            #   def create
            #     response = SomeService.new(organization: Current.organization).execute
            #   end
            # end
            #
            # class SomeService
            #   def initialize(organization:)
            #     @organization = organization
            #   end
            #
            #   def execute
            #     do_something_with(@organization)
            #   end
            # end
      ```
      3e3e7e34
加载中