Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synchronize shared configuration #1229

Merged
merged 23 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
dbbea39
dependabot.yml: update to match main configuration
BrewTestBot Jun 11, 2024
83ba6fe
docs.yml: update to match main configuration
BrewTestBot Jun 11, 2024
45f955f
.vale.ini: update to match main configuration
BrewTestBot Jun 11, 2024
27e4779
.mdl_ruleset.rb: update to match main configuration
BrewTestBot Jun 11, 2024
ad16d90
.mdl_style.rb: update to match main configuration
BrewTestBot Jun 11, 2024
0bfc529
.mdlrc: update to match main configuration
BrewTestBot Jun 11, 2024
1f3a70e
.rubocop.yml: update to match main configuration
BrewTestBot Jun 11, 2024
cd88d83
.ruby-version: update to match main configuration
BrewTestBot Jun 11, 2024
fdf40c1
Gemfile: update to match main configuration
BrewTestBot Jun 11, 2024
26d1e0a
Rakefile: update to match main configuration
BrewTestBot Jun 11, 2024
b8c4d0e
robots.txt: update to match main configuration
BrewTestBot Jun 11, 2024
dbb0a4f
Abbreviations.yml: update to match main configuration
BrewTestBot Jun 11, 2024
47073b6
OxfordComma.yml: update to match main configuration
BrewTestBot Jun 11, 2024
dffeeb6
Pronouns.yml: update to match main configuration
BrewTestBot Jun 11, 2024
3635cd2
Spacing.yml: update to match main configuration
BrewTestBot Jun 11, 2024
2e5ae1f
Terms.yml: update to match main configuration
BrewTestBot Jun 11, 2024
d0ad562
Titles.yml: update to match main configuration
BrewTestBot Jun 11, 2024
6fa42f7
Trademarks.yml: update to match main configuration
BrewTestBot Jun 11, 2024
cfcbff2
docs: fix Vale linting errors.
MikeMcQuaid Jun 11, 2024
59a69dd
docs/api: fix Markdown linting errors.
MikeMcQuaid Jun 11, 2024
5d4f3a0
workflows/docs: generate API samples.
MikeMcQuaid Jun 11, 2024
593f9f7
Rakefile: ignore root.
MikeMcQuaid Jun 11, 2024
834a517
gitignore: ignore docs generated files.
MikeMcQuaid Jun 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 20 additions & 49 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,24 @@
# This file is synced from the `.github` repository, do not modify it directly.
---
version: 2

updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
allow:
- dependency-type: all
# The actions in triage-issues.yml are updated in the Homebrew/.github repo
ignore:
- dependency-name: actions/stale
- dependency-name: dessant/lock-threads
groups:
artifacts:
patterns:
- actions/*-artifact

- package-ecosystem: bundler
directory: /
schedule:
interval: daily
allow:
- dependency-type: all

- package-ecosystem: npm
directory: /
schedule:
interval: daily
allow:
- dependency-type: all

- package-ecosystem: docker
directory: /
schedule:
interval: daily
allow:
- dependency-type: all

- package-ecosystem: devcontainers
directory: /
schedule:
interval: daily
allow:
- dependency-type: all
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
allow:
- dependency-type: all
ignore:
- dependency-name: actions/stale
- dependency-name: dessant/lock-threads
groups:
artifacts:
patterns:
- actions/*-artifact
- package-ecosystem: bundler
directory: "/"
schedule:
interval: daily
allow:
- dependency-type: all

- package-ecosystem: pip
directory: /
schedule:
interval: daily
allow:
- dependency-type: all
74 changes: 74 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Documentation CI

on:
push:
branches:
- master
pull_request:

permissions:
contents: read

env:
HOMEBREW_DEVELOPER: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_ENV_HINTS: 1
HOMEBREW_BOOTSNAP: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1

jobs:
docs:
runs-on: ubuntu-22.04
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
core: false
cask: false
test-bot: false

- name: Checkout repository
uses: actions/checkout@v4

- name: Install vale
run: brew install vale

- name: Cleanup Homebrew/brew docs
if: github.repository == 'Homebrew/brew'
run: |
set -xeuo pipefail

# Avoid failing on broken symlinks.
rm Library/Homebrew/os/mac/pkgconfig/fuse/fuse.pc
rm Library/Homebrew/os/mac/pkgconfig/fuse/osxfuse.pc

# No ignore support (https://github.com/errata-ai/vale/issues/131).
rm -r Library/Homebrew/vendor

- name: Run Vale
run: vale docs/

- name: Install Ruby
uses: ruby/setup-ruby@78c01b705fd9d5ad960d432d3a0cfa341d50e410 # v1.179.1
with:
bundler-cache: true
working-directory: docs

- name: Check Markdown syntax
working-directory: docs
run: bundle exec rake lint

- name: Check code blocks conform to our Ruby style guide
run: brew style docs

- name: Generate formulae.brew.sh API samples
if: github.repository == 'Homebrew/formulae.brew.sh'
working-directory: docs
run: ../script/generate-api-samples.rb

- name: Build the site and check for broken links
working-directory: docs
run: bundle exec rake test
env:
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ api/cask-source/
api/cask/
api/formula/
api/internal/
docs/_includes/api-samples/
docs/tmp/
docs/Gemfile.lock
cask/
formula/
7 changes: 7 additions & 0 deletions .vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
StylesPath = ./docs/vale-styles

[formats]
rb = md

[*.{md,rb}]
BasedOnStyles = Homebrew
7 changes: 7 additions & 0 deletions docs/.mdl_ruleset.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
rule 'HB034', 'Bare unstyled URL used' do
tags :links, :url
aliases 'no-bare-unstyled-urls'
check do |doc|
doc.matching_text_element_lines(%r{(?<=\s)https?://})
end
end
8 changes: 8 additions & 0 deletions docs/.mdl_style.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
all
rule 'MD007', indent: 2 # Unordered list indentation
rule 'MD026', punctuation: ',;:' # Trailing punctuation in header
exclude_rule 'MD013' # Line length
exclude_rule 'MD029' # Ordered list item prefix
exclude_rule 'MD033' # Inline HTML
exclude_rule 'MD034' # Bare URL used (replaced by HB034)
exclude_rule 'MD046' # Code block style
4 changes: 4 additions & 0 deletions docs/.mdlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
git_recurse true
ignore_front_matter true
style "#{File.dirname(__FILE__)}/.mdl_style.rb"
rulesets ["#{File.dirname(__FILE__)}/.mdl_ruleset.rb"]
32 changes: 32 additions & 0 deletions docs/.rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
inherit_from: ../Library/.rubocop.yml

AllCops:
Exclude:
- Gemfile
- ".mdl*.rb"
- Rakefile
- "_site/**/*"
- Manpage.md

# These are included in docs deliberately to show what
# `brew create` does and what the user should replace.
FormulaAudit/Comments:
Enabled: false

# This forces us to use dummy descriptions/homepages in example formulae which we don't need to clutter the docs with.
FormulaAudit/Desc:
Enabled: false
FormulaAudit/Homepage:
Enabled: false

Layout/LineLength:
Exclude:
- Bottles.md # The bottle block line length is long in its full form.

# Apparently Casks are allowed to have constant definitions in blocks and we document this.
Lint/ConstantDefinitionInBlock:
Enabled: false

# A fake regexp is deliberately documented for `inreplace` in the Formula Cookbook.
Style/RedundantRegexpArgument:
Enabled: false
1 change: 1 addition & 0 deletions docs/.ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.3.2
12 changes: 12 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
source "https://rubygems.org"

ruby file: ".ruby-version"

gem "github-pages", group: :jekyll_plugins

group :test do
gem "html-proofer"
gem "mdl"
gem "rake"
gem "webrick"
end
43 changes: 43 additions & 0 deletions docs/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
require "rake"

task default: :build

desc "Build the site."
task :build do
sh "jekyll", "build"
end

desc "Run Markdownlint to validate the Markdown style."
task :lint do
sh "mdl $(git ls-files '*.md' | grep -v 'Manpage.md')"
end

desc "Run HTMLProofer to validate the HTML output."
task test: :build do
require "html-proofer"
HTMLProofer.check_directory(
"./_site",
parallel: { in_threads: 4 },
favicon: true,
ignore_status_codes: [0, 403],
check_favicon: true,
check_opengraph: true,
check_html: true,
check_img_http: true,
enforce_https: true,
ignore_files: [
%r{Kickstarter-Supporters},
],
ignore_urls: [
"/",
%r{https://formulae.brew.sh"},
%r{https://github.com/},
'https://legacy.python.org/dev/peps/pep-0453/#recommendations-for-downstream-distributors',
],
cache: {
timeframe: {
external: "1h"
}
}
).run
end
Loading