<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # Style guides > 原文:[https://docs.gitlab.com/ee/development/contributing/style_guides.html](https://docs.gitlab.com/ee/development/contributing/style_guides.html) * [Editor/IDE styling standardization](#editoride-styling-standardization) * [Pre-commit static analysis](#pre-commit-static-analysis) * [Ruby, Rails, RSpec](#ruby-rails-rspec) * [Creating new RuboCop cops](#creating-new-rubocop-cops) * [Database migrations](#database-migrations) * [JavaScript](#javascript) * [SCSS](#scss) * [Go](#go) * [Shell commands (Ruby)](#shell-commands-ruby) * [Shell scripting](#shell-scripting) * [Markdown](#markdown) * [Documentation](#documentation) * [Python](#python) * [Misc](#misc) # Style guides[](#style-guides "Permalink") ## Editor/IDE styling standardization[](#editoride-styling-standardization "Permalink") 在將文件保存到本地之前,我們使用[EditorConfig](https://editorconfig.org/)自動應用某些樣式標準. 默認情況下,大多數編輯器/ IDE 都會自動接受`.editorconfig`設置. 如果您的編輯器/ IDE 不自動支持`.editorconfig` ,建議您進行調查以查看是否存在插件. 例如,這里是[vim](https://github.com/editorconfig/editorconfig-vim)的[插件](https://github.com/editorconfig/editorconfig-vim) . ## Pre-commit static analysis[](#pre-commit-static-analysis "Permalink") 強烈建議您安裝[Overcommit](https://github.com/sds/overcommit) ,以便在本地提交之前自動檢查靜態分析違規. 在您的 GitLab 源目錄中運行: ``` make -C tooling/overcommit ``` Then before a commit is created, Overcommit will automatically check for RuboCop (and other checks) offenses on every modified file. 這樣可以節省您的時間,因為您不必等待配置項檢測到相同的錯誤. 過量提交依賴于預提交鉤子,以防止違反其規則集的提交. 如果您想覆蓋此行為,可以通過傳遞 ENV 變量`OVERCOMMIT_DISABLE`來完成. 即`OVERCOMMIT_DISABLE=1 git rebase master`在禁用 Git 鉤子的同時進行 rebase. ## Ruby, Rails, RSpec[](#ruby-rails-rspec "Permalink") 我們的代碼庫樣式由[RuboCop](https://github.com/rubocop-hq/rubocop)定義和執行. 您可以使用`bundle exec rubocop --parallel`在本地檢查任何違規行為. 在配置項上,這將由`static-analysis`作業自動檢查. 對于尚未決定的 RuboCop 規則,我們遵循[Ruby Style Guide](https://github.com/rubocop-hq/ruby-style-guide) , [Rails Style Guide](https://github.com/rubocop-hq/rails-style-guide)和[RSpec Style Guide](https://github.com/rubocop-hq/rspec-style-guide)作為編寫慣用 Ruby / Rails / RSpec 的通用準則,但是審閱者/維護者應該寬容而不是太寬容關于風格的書呆子. 同樣,當前已禁用某些 RuboCop 規則,對于這些規則,審閱者/維護者不得要求作者使用一種或另一種樣式,因為這兩種樣式均被接受. 這不是理想的情況,因為這為[騎車](https://en.wiktionary.org/wiki/bikeshedding)留下了空間,并且理想情況下,我們應該啟用所有 RuboCop 規則,以避免在評論中進行與樣式相關的討論/挑剔/來回. 此外,我們還有專門的[換行樣式指南](../newlines_styleguide.html) ,以及專門針對[測試的樣式指南和最佳實踐](../testing_guide/index.html) . ### Creating new RuboCop cops[](#creating-new-rubocop-cops "Permalink") 通常,最好通過編程方式執行起毛規則,因為它可以減少前述的[自行車脫落](https://en.wiktionary.org/wiki/bikeshedding) . 為此,我們鼓勵在代碼庫中創建新的 RuboCop 規則. 當創建可以應用于多個應用程序的新警察時,我們建議您將其添加到我們的[GitLab Styles](https://gitlab.com/gitlab-org/gitlab-styles)寶石中. ## Database migrations[](#database-migrations "Permalink") 請參閱專用的《 [數據庫遷移樣式指南》](../migration_style_guide.html) . ## JavaScript[](#javascript "Permalink") 請參閱專用的[JS 樣式指南](../fe_guide/style/javascript.html) . ## SCSS[](#scss "Permalink") 請參閱專用的[SCSS 樣式指南](../fe_guide/style/scss.html) . ## Go[](#go "Permalink") 請參閱專用的[Go 標準和樣式指南](../go_guide/index.html) . ## Shell commands (Ruby)[](#shell-commands-ruby "Permalink") 請參閱[GitLab 代碼庫中有關 shell 命令](../shell_commands.html)的專用[準則](../shell_commands.html) . ## Shell scripting[](#shell-scripting "Permalink") 請參閱專用的[Shell 腳本標準和樣式指南](../shell_scripting_guide/index.html) . ## Markdown[](#markdown "Permalink") 我們正在遵循[Ciro Santilli 的 Markdown 樣式指南](https://cirosantilli.com/markdown-style-guide/) . ## Documentation[](#documentation "Permalink") 請參閱專用的[文檔樣式指南](../documentation/styleguide.html) . ## Python[](#python "Permalink") 請參閱專用的[Python 開發指南](../python_guide/index.html) . ## Misc[](#misc "Permalink") 代碼應使用[美國英語](https://en.wikipedia.org/wiki/American_English)書寫. * * * [Return to Contributing documentation](index.html)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看