Skip to content

Commit

Permalink
Merge pull request #926 from rubygems/tnir-haml_lint-line_length-250
Browse files Browse the repository at this point in the history
Set max value for LineLength in HAML-Lint linter
  • Loading branch information
tnir authored Sep 14, 2022
2 parents 6d3b338 + 17d8586 commit 27192e2
Show file tree
Hide file tree
Showing 16 changed files with 110 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .haml-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ linters:
- "source/layouts/_navbar.haml"

LineLength:
max: 849
max: 250

RuboCop:
enabled: true
Expand Down
26 changes: 18 additions & 8 deletions source/guides/bundler_plugins.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ title: How to write a Bundler plugin
Install a plugin from a command

%p
Plugins can be installed from RubyGems (default) or from a Git server. To use a gem on your machine, you can run <code>bundler plugin install gem_name</code>. Once the plugin is installed, the commands will be available for use and the hooks will be automatically registered with Bundler.
Plugins can be installed from RubyGems (default) or from a Git server.
To use a gem on your machine, you can run <code>bundler plugin install gem_name</code>.
Once the plugin is installed, the commands will be available for use and the hooks will be automatically registered with Bundler.

%p
Run <code>bundler plugin help install</code> for more details help and instructions on installing from Git.
Expand Down Expand Up @@ -97,10 +99,12 @@ title: How to write a Bundler plugin
2. Create a plugins.rb file

%p
A <code>plugins.rb</code> file is located at the top level of your gem's folder and is the entry point Bundler will use to call your plugin. This is a Ruby file that defines your commands, hooks, and other code. Often, you may just require the gem's upper-most lib file.
A <code>plugins.rb</code> file is located at the top level of your gem's folder and is the entry point Bundler will use to call your plugin.
This is a Ruby file that defines your commands, hooks, and other code. Often, you may just require the gem's upper-most lib file.

%p
For example, if your gem is called "my_plugin", you might have a file at <code>lib/my_plugin.rb</code> which contains the highest level namespace for your gem. Your <code>plugins.rb</code> file might be:
For example, if your gem is called "my_plugin", you might have a file at <code>lib/my_plugin.rb</code> which contains the highest level namespace for your gem.
Your <code>plugins.rb</code> file might be:

:code
# lang: ruby
Expand All @@ -114,7 +118,8 @@ title: How to write a Bundler plugin
Bundler commands allow you to extend the Bundler interface with additional functionality.

%p
To add a Bundler command, you need to make a class that registers itself (or another class) as a command. For example, to add support for a <code>bundler my_command</code> command, you might create a class like so:
To add a Bundler command, you need to make a class that registers itself (or another class) as a command.
For example, to add support for a <code>bundler my_command</code> command, you might create a class like so:

:code
# lang: ruby
Expand Down Expand Up @@ -158,15 +163,18 @@ title: How to write a Bundler plugin
%h4#raising-errors{ id: 'raising_errors' }
Raising Errors
%p
If something goes wrong, your plugins should raise a `BundlerError`. It's not recommended to raise e.g. `Exception` in a plugin, because that will cause Bundler to print its own bug report template, asking users to report the bug to Bundler itself.
If something goes wrong, your plugins should raise a `BundlerError`.
It's not recommended to raise e.g. `Exception` in a plugin, because that will cause Bundler to print its own bug report template, asking users to report the bug to Bundler itself.
%p
To see in detail how bundler rescues errors, check out `bundler/friendly_errors.rb`.

%h3#developing-your-plugin-hooks{ id: 'developing_your_plugin_hooks' }
4. Using Bundler hooks

%p
To interface with various parts of Bundler, you can use a hook. Hooks will let you inject some functionality at specific events by registering to listen for specific things to happen. To listen to an event, you need to add a hook for it and provide a block.
To interface with various parts of Bundler, you can use a hook.
Hooks will let you inject some functionality at specific events by registering to listen for specific things to happen.
To listen to an event, you need to add a hook for it and provide a block.

%p
For example, for a <code>Bundler::Plugin::Events::GEM_BEFORE_INSTALL_ALL</code> hook you must give a block that has an argument for an Array of <code>Bundler::Dependency</code> objects:
Expand All @@ -180,7 +188,8 @@ title: How to write a Bundler plugin
5. Developing a source plugin

%p
A source plugin allows you to specify more possible installation sources to use within Bundler. For example, let's say you want to install gems from Amazon S3. This can be done by building a plugin.
A source plugin allows you to specify more possible installation sources to use within Bundler.
For example, let's say you want to install gems from Amazon S3. This can be done by building a plugin.

%p
It is recommended to get familiar with the API for <code>Bundler::Plugin::API::Source</code> which is available
Expand All @@ -192,7 +201,8 @@ title: How to write a Bundler plugin
= link_to 'in the source code.', 'https://github.com/bundler/bundler/blob/master/lib/bundler/plugin/api/source.rb'

%p
The basic overview of the source plugin is that you must subclass <code>Bundler::Plugin::API::Source</code> and override a number of methods. Those methods are indicated in the docs/source code linked above.
The basic overview of the source plugin is that you must subclass <code>Bundler::Plugin::API::Source</code> and override a number of methods.
Those methods are indicated in the docs/source code linked above.

%p
Bundler uses the source plugin API to provide interfaces for RubyGems, Git, and path-based gems. The source code for these pieces may prove useful in understanding the API:
Expand Down
4 changes: 3 additions & 1 deletion source/guides/deploying.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ title: How to deploy bundled applications
.bullet
.description
%h3 Heroku
When you deploy to Heroku, Bundler will be run automatically as long as a Gemfile is present. If you check in your Gemfile.lock, Heroku will run <code>`bundle install --deployment`</code>. If you want to exclude certain groups using the <code>--without</code> option, you need to use <code>`heroku config`</code>.
When you deploy to Heroku, Bundler will be run automatically as long as a Gemfile is present.
If you check in your Gemfile.lock, Heroku will run <code>`bundle install --deployment`</code>.
If you want to exclude certain groups using the <code>--without</code> option, you need to use <code>`heroku config`</code>.
:code
$ heroku config:set BUNDLE_WITHOUT="test development" --app app_name
= link_to 'Heroku Bundler Documentation', 'http://docs.heroku.com/bundler', class: 'btn btn-primary'
Expand Down
17 changes: 12 additions & 5 deletions source/guides/gemfile.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@
.contents
.bullet
.description
Gemfiles require at least one gem source, in the form of the URL for a RubyGems server. Generate a Gemfile with the default rubygems.org source by running <code>bundle init</code>. If you can, use <code>https</code> so your connection to the rubygems.org server will be verified with SSL.
Gemfiles require at least one gem source, in the form of the URL for a RubyGems server.
Generate a Gemfile with the default rubygems.org source by running <code>bundle init</code>.
If you can, use <code>https</code> so your connection to the rubygems.org server will be verified with SSL.
:code
# lang: ruby
source 'https://rubygems.org'

# Gems here
.notes
If you want to pick up gems from a different source, make sure to wrap the extra sources in a block. Multiple global source lines are a security risk and should not be used as they can lead to gems being installed from unintended sources.
If you want to pick up gems from a different source, make sure to wrap the extra sources in a block.
Multiple global source lines are a security risk and should not be used as they can lead to gems being installed from unintended sources.
:code
# lang: ruby
source 'https://rubygems.org'
Expand Down Expand Up @@ -131,7 +134,8 @@

.bullet
.description
If you would like to use multiple local gems directly from the filesystem, you can set a global `path` option to the path containing the gem's files. This will automatically load gemspec files from subdirectories.
If you would like to use multiple local gems directly from the filesystem, you can set a global `path` option to the path containing the gem's files.
This will automatically load gemspec files from subdirectories.
:code
# lang: ruby
path 'components' do
Expand All @@ -154,13 +158,16 @@

.bullet
.description
You can specify the required version of Ruby in the <code>Gemfile</code> with <code>ruby</code>. If the <code>Gemfile</code> is loaded on a different Ruby version, Bundler will raise an exception with an explanation.
You can specify the required version of Ruby in the <code>Gemfile</code> with <code>ruby</code>.
If the <code>Gemfile</code> is loaded on a different Ruby version, Bundler will raise an exception with an explanation.
:code
# lang: ruby
ruby '1.9.3'
.bullet
.description
What this means is that this app has a dependency to a Ruby VM that is ABI compatible with 1.9.3. If the version check does not match, Bundler will raise an exception. This will ensure the running code matches. You can be more specific with the <code>:engine</code> and <code>:engine_version</code> options.
What this means is that this app has a dependency to a Ruby VM that is ABI compatible with 1.9.3.
If the version check does not match, Bundler will raise an exception. This will ensure the running code matches.
You can be more specific with the <code>:engine</code> and <code>:engine_version</code> options.
:code
# lang: ruby
ruby '1.9.3', :engine => 'jruby', :engine_version => '1.6.7'
Expand Down
14 changes: 10 additions & 4 deletions source/guides/gemfile_ruby.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
.contents
.bullet
.description
Like gems, developers can setup a dependency on Ruby. This makes your app fail faster in case you depend on specific features in a Ruby VM. This way, the Ruby VM on your deployment server will match your local one. You can do this by using the <code>ruby</code> directive in the <code>Gemfile</code>:
Like gems, developers can setup a dependency on Ruby.
This makes your app fail faster in case you depend on specific features in a Ruby VM.
This way, the Ruby VM on your deployment server will match your local one. You can do this by using the <code>ruby</code> directive in the <code>Gemfile</code>:
:code
# lang: ruby
ruby 'RUBY_VERSION', :engine => 'ENGINE', :engine_version => 'ENGINE_VERSION',
Expand Down Expand Up @@ -32,7 +34,9 @@

.bullet
.description
Both <code>:engine</code> and <code>:engine_version</code> are optional. When these options are omitted, this means the app is compatible with a particular Ruby ABI but the engine is irrelevant. When <code>:engine</code> is used, <code>:engine_version</code> must also be specified.
Both <code>:engine</code> and <code>:engine_version</code> are optional.
When these options are omitted, this means the app is compatible with a particular Ruby ABI but the engine is irrelevant.
When <code>:engine</code> is used, <code>:engine_version</code> must also be specified.
.bullet
.description
Using the <code>platform</code> command with the <code>--ruby</code> flag, you can see what <code>ruby</code> directive is specified in the <code>Gemfile</code>.
Expand All @@ -42,11 +46,13 @@

.bullet
.description
In the <code>ruby</code> directive, <code>:patchlevel</code> is optional, as patchlevel releases are usually compatible and include important security fixes. The patchlevel option checks the <code>RUBY_PATCHLEVEL</code> constant, and if not specified then bundler will simply ignore it.
In the <code>ruby</code> directive, <code>:patchlevel</code> is optional, as patchlevel releases are usually compatible and include important security fixes.
The patchlevel option checks the <code>RUBY_PATCHLEVEL</code> constant, and if not specified then bundler will simply ignore it.

.bullet
.description
Version operators for specifying a Ruby version are also available. The set of supported version operators is that of Rubygems (<code>gem</code> version operators). (ie. <code><</code>, <code>></code>, <code><=</code>, <code>>=</code>, <code>~></code>, <code>=</code>)
Version operators for specifying a Ruby version are also available.
The set of supported version operators is that of Rubygems (<code>gem</code> version operators). (ie. <code><</code>, <code>></code>, <code><=</code>, <code>>=</code>, <code>~></code>, <code>=</code>)
:code
# lang: ruby
ruby '~> 2.3.0'
Expand Down
9 changes: 8 additions & 1 deletion source/guides/getting_started.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,14 @@ title: Getting Started

%h2#get-involved Get involved
%p.contents
Bundler has a lot of contributors and users, and they all talk to each other quite a bit. If you have questions, try #{link_to 'the IRC channel', 'http://webchat.freenode.net/?channels=bundler'} or #{link_to 'mailing list', 'http://groups.google.com/group/ruby-bundler'}. If you're interested in contributing to the project (no programming skills needed), read #{link_to 'the contributing guide', 'https://github.com/rubygems/rubygems/blob/master/bundler/doc/contributing/README.md'} or #{link_to 'the development guide', 'https://github.com/bundler/bundler/blob/master/doc/development/README.md'}. While participating in the Bundler project, please keep the #{link_to 'code of conduct', '/conduct.html'} in mind, and be inclusive and friendly towards everyone. If you have sponsorship or security questions, please contact the core team directly.
Bundler has a lot of contributors and users, and they all talk to each other quite a bit.
If you have questions, try #{link_to 'the IRC channel', 'http://webchat.freenode.net/?channels=bundler'}
or #{link_to 'mailing list', 'http://groups.google.com/group/ruby-bundler'}.
If you're interested in contributing to the project (no programming skills needed),
read #{link_to 'the contributing guide', 'https://github.com/rubygems/rubygems/blob/master/bundler/doc/contributing/README.md'}
or #{link_to 'the development guide', 'https://github.com/bundler/bundler/blob/master/doc/development/README.md'}.
While participating in the Bundler project, please keep the #{link_to 'code of conduct', '/conduct.html'}
in mind, and be inclusive and friendly towards everyone. If you have sponsorship or security questions, please contact the core team directly.

.contents
.buttons
Expand Down
6 changes: 4 additions & 2 deletions source/guides/rubygems.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@
gem "rspec", "~> 3.9"
gem "rubocop", "0.79.0"
.notes
In this Gemfile, the `gemspec` method imports gems listed with `add_runtime_dependency` in the `my_gem.gemspec` file, and it also installs rspec and rubocop to test and develop the gem. All dependencies from the gemspec and Gemfile will be installed by `bundle install`, but rspec and rubocop will not be included by `gem install mygem` or `bundle add mygem`.
In this Gemfile, the `gemspec` method imports gems listed with `add_runtime_dependency` in the `my_gem.gemspec` file, and it also installs rspec and rubocop to test and develop the gem.
All dependencies from the gemspec and Gemfile will be installed by `bundle install`, but rspec and rubocop will not be included by `gem install mygem` or `bundle add mygem`.
.bullet
.description
Runtime dependencies in your gemspec are treated as if they are listed in your Gemfile, and development dependencies are added by default to the group, <code>:development</code>. You can change that group with the <code>:development_group</code> option
Runtime dependencies in your gemspec are treated as if they are listed in your Gemfile, and development dependencies are added by default to the group, <code>:development</code>.
You can change that group with the <code>:development_group</code> option
:code
# lang: ruby
gemspec :development_group => :dev
Expand Down
2 changes: 2 additions & 0 deletions source/layouts/_navbar.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
%input.input-search.my-1.ps-1.pt-1#input-search{type: :text, placeholder: t('search.placeholder')}
%svg.text-opacity-40.m-1.mb-2{xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", style: "width: 1rem; height: 1rem; fill: currentcolor;"}
/ Font Awesome Free 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.
-# haml-lint:disable LineLength
%path{d: "M500.3 443.7l-119.7-119.7c27.22-40.41 40.65-90.9 33.46-144.7C401.8 87.79 326.8 13.32 235.2 1.723C99.01-15.51-15.51 99.01 1.724 235.2c11.6 91.64 86.08 166.7 177.6 178.9c53.8 7.189 104.3-6.236 144.7-33.46l119.7 119.7c15.62 15.62 40.95 15.62 56.57 0C515.9 484.7 515.9 459.3 500.3 443.7zM79.1 208c0-70.58 57.42-128 128-128s128 57.42 128 128c0 70.58-57.42 128-128 128S79.1 278.6 79.1 208z"}
-# haml-lint:enable LineLength
%li.nav-item= link_to t('navbar.docs'), '/docs.html', class: "nav-link"
%li.nav-item= link_to t('navbar.team'), '/contributors.html', class: "nav-link"
%li.nav-item= link_to t('navbar.blog'), '/blog', class: "nav-link"
Expand Down
2 changes: 2 additions & 0 deletions source/localizable/about.en.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ layout: two_column_layout
= link_to "github-pages Deployment history", "https://github.com/rubygems/bundler-site/deployments/activity_log?environment=github-pages"
Custom domain is used to host `bundler.io` (see also
= succeed ")." do
-# haml-lint:disable LineLength
= link_to "Managing a custom domain for your GitHub Pages site", "https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site#configuring-a-subdomain"
-# haml-lint:enable LineLength
%p
As seen above, you might sometimes take care about the difference in
deploy methods between review apps and production. Unlike production
Expand Down
8 changes: 7 additions & 1 deletion source/localizable/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,13 @@
.mx-xl-5.px-xl-5
%h2#get-involved Get involved
.my-4.large-font
Bundler has a lot of contributors and users, and we would love to have your help! If you have questions, join #{link_to 'the Bundler Slack', 'http://slack.bundler.io'} and we'll try to answer them. If you're interested in contributing (no programming skills needed), start with #{link_to 'the contributing guide', 'https://github.com/rubygems/rubygems/blob/master/bundler/doc/contributing/README.md'}. While participating in the Bundler project, please keep the #{link_to 'code of conduct', '/conduct.html'} in mind, and be inclusive and friendly towards everyone. If you think you've found a security issue, please report it via #{link_to 'HackerOne', 'https://hackerone.com/rubygems'}.
Bundler has a lot of contributors and users, and we would love to have your help!
If you have questions, join #{link_to 'the Bundler Slack', 'http://slack.bundler.io'}
and we'll try to answer them. If you're interested in contributing (no programming skills needed), start with
#{link_to 'the contributing guide', 'https://github.com/rubygems/rubygems/blob/master/bundler/doc/contributing/README.md'}.
While participating in the Bundler project, please keep the #{link_to 'code of conduct', '/conduct.html'}
in mind, and be inclusive and friendly towards everyone.
If you think you've found a security issue, please report it via #{link_to 'HackerOne', 'https://hackerone.com/rubygems'}.

.d-grid.d-md-flex.gap-2.mx-auto.my-md-4.justify-content-md-center
= link_to 'Code of Conduct', '/conduct.html', class: 'btn btn-primary btn-lg'
Expand Down
Loading

0 comments on commit 27192e2

Please sign in to comment.