Skip to content

Commit

Permalink
Replace old master branch with main (#460)
Browse files Browse the repository at this point in the history
* Replace `master` with `main`

Signed-off-by: Mathieu Rul <mathroule@gmail.com>
  • Loading branch information
mathroule committed Sep 8, 2023
1 parent 3d760ba commit fff917c
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

## Related Issues
<!--- If you are suggesting a new feature or change, please create an issue first -->
<!--- Add a link to all corresponding Github issues here, using any [appropriate keywords](https://help.github.com/en/articles/closing-issues-using-keywords) as appropriate -->
<!--- Add a link to all corresponding GitHub issues here, using any [appropriate keywords](https://help.github.com/en/articles/closing-issues-using-keywords) as appropriate -->

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
### Added

* You can now load your own custom rules with the `-u` option. See
[rules.rb](https://github.com/markdownlint/markdownlint/blob/master/lib/mdl/rules.rb)
[rules.rb](https://github.com/markdownlint/markdownlint/blob/main/lib/mdl/rules.rb)
for an example of what a rules file looks like. Use the `-d` option if you
don't want to load markdownlint's default ruleset.
* You can now refer to rules by human-readable/writable aliases, such as
Expand Down Expand Up @@ -280,7 +280,7 @@
* MD029 - Ordered list item prefix
* MD030 - Spaces after list markers

[Unreleased]: https://github.com/markdownlint/markdownlint/tree/master
[Unreleased]: https://github.com/markdownlint/markdownlint/tree/main
[v0.12.0]: https://github.com/markdownlint/markdownlint/tree/v0.12.0
[v0.11.0]: https://github.com/markdownlint/markdownlint/tree/v0.11.0
[v0.10.0]: https://github.com/markdownlint/markdownlint/tree/v0.10.0
Expand Down
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spending time and effort writing code that might not get used.

* Check that the issue has not already been reported
* Check that the issue has not already been fixed in the latest code
(a.k.a. `master`)
(a.k.a. `main`)
* Select the appropriate issue type and open an issue with a descriptive title
* Be clear, concise, and precise using grammatically correct, complete sentences
in your summary of the problem
Expand Down Expand Up @@ -98,9 +98,9 @@ respond to your pull request with any feedback they might have. The process at
this point is as follows:

1. A review is required from at least one of the project maintainers. See the
master maintainers document for Markdownlint project at
<https://github.com/markdownlint/markdownlint/blob/master/MAINTAINERS.md>.
1. Your change will be merged into the project's `master` branch, and all
maintainers document for Markdownlint project at
<https://github.com/markdownlint/markdownlint/blob/main/MAINTAINERS.md>.
1. Your change will be merged into the project's `main` branch, and all
[commits will be
squashed](https://help.github.com/en/articles/about-pull-request-merges#squash-and-merge-your-pull-request-commits)
during the merge.
Expand Down
2 changes: 1 addition & 1 deletion docs/rolling_a_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Bump the version. Markdownlint uses semantic versioning. From
* Exception: Versions < 1.0 may introduce backwards-incompatible changes in a
minor version.

To bump the version, edit `lib/mdl/version.rb` and commit to the master branch.
To bump the version, edit `lib/mdl/version.rb` and commit to the main branch.

Update the changelog:

Expand Down
7 changes: 3 additions & 4 deletions lib/mdl/doc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -281,16 +281,15 @@ def extract_as_text(element)
# If anything goes amiss here, e.g. unknown type, then nil will be
# returned and we'll just not catch that part of the text, which seems
# like a sensible failure mode.
lines = element.children.map do |e|
if e.type == :text or e.type == :codespan
element.children.map do |e|
if e.type == :text || e.type == :codespan
e.value
elsif %i{strong em p a}.include?(e.type)
elsif %i{strong em p a}.include?(e.type)
extract_as_text(e).join("\n")
elsif e.type == :smart_quote
quotes[e.value]
end
end.join.split("\n")
lines
end

private
Expand Down
11 changes: 5 additions & 6 deletions lib/mdl/rules.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
docs do |id, description|
url_hash = [id.downcase,
description.downcase.gsub(/[^a-z]+/, '-')].join('---')
"https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md##{url_hash}"
"https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md##{url_hash}"
end

rule 'MD001', 'Header levels should only increment by one level at a time' do
Expand Down Expand Up @@ -126,7 +126,7 @@
end

rule 'MD006', 'Consider starting bulleted lists at the beginning of the line' do
# Starting at the beginning of the line means that indendation for each
# Starting at the beginning of the line means that indentation for each
# bullet level can be identical.
tags :bullet, :ul, :indentation
aliases 'ul-start-left'
Expand Down Expand Up @@ -459,10 +459,9 @@
doc.find_type_elements(:blockquote).each do |e|
linenum = doc.element_linenumber(e)
lines = doc.extract_as_text(e)
# Handle first line specially as whitespace is stripped from the text element
if doc.element_line(e).match(/^\s*> /)
errors << linenum
end
# Handle first line specially as whitespace is stripped from the text
# element
errors << linenum if doc.element_line(e).match(/^\s*> /)
lines.each do |line|
errors << linenum if line.start_with?(' ')
linenum += 1
Expand Down
2 changes: 1 addition & 1 deletion lib/mdl/style.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def self.load(style_file, rules)
warn "#{style_file} does not appear to be a built-in style." +
' If you meant to pass in your own style file, it must contain' +
" a '/' or end in '.rb'. See https://github.com/markdownlint/" +
'markdownlint/blob/master/docs/configuration.md'
'markdownlint/blob/main/docs/configuration.md'
exit(1)
end
style_file = tmp
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/output/json/with_matches.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"filename":"(stdin)","line":1,"rule":"MD002","aliases":["first-header-h1"],"description":"First header should be a top level header","docs":"https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md#md002---first-header-should-be-a-top-level-header"}]
[{"filename":"(stdin)","line":1,"rule":"MD002","aliases":["first-header-h1"],"description":"First header should be a top level header","docs":"https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md002---first-header-should-be-a-top-level-header"}]
2 changes: 1 addition & 1 deletion test/fixtures/output/sarif/with_matches.sarif
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","version":"2.1.0","runs":[{"tool":{"driver":{"name":"Markdown lint","version":"0.12.0","informationUri":"https://github.com/markdownlint/markdownlint","rules":[{"id":"MD002","name":"FirstHeaderH1","defaultConfiguration":{"level":"note"},"properties":{"description":"First header should be a top level header","tags":["headers"],"queryURI":"https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md#md002---first-header-should-be-a-top-level-header"},"shortDescription":{"text":"First header should be a top level header"},"fullDescription":{"text":"First header should be a top level header"},"helpUri":"https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md#md002---first-header-should-be-a-top-level-header","help":{"text":"More info: https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md#md002---first-header-should-be-a-top-level-header","markdown":"[More info](https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md#md002---first-header-should-be-a-top-level-header)"}}]}},"results":[{"ruleId":"MD002","ruleIndex":0,"message":{"text":"MD002 - First header should be a top level header"},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"(stdin)","uriBaseId":"%SRCROOT%"},"region":{"startLine":1}}}]}]}]}
{"$schema":"https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json","version":"2.1.0","runs":[{"tool":{"driver":{"name":"Markdown lint","version":"0.12.0","informationUri":"https://github.com/markdownlint/markdownlint","rules":[{"id":"MD002","name":"FirstHeaderH1","defaultConfiguration":{"level":"note"},"properties":{"description":"First header should be a top level header","tags":["headers"],"queryURI":"https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md002---first-header-should-be-a-top-level-header"},"shortDescription":{"text":"First header should be a top level header"},"fullDescription":{"text":"First header should be a top level header"},"helpUri":"https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md002---first-header-should-be-a-top-level-header","help":{"text":"More info: https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md002---first-header-should-be-a-top-level-header","markdown":"[More info](https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md002---first-header-should-be-a-top-level-header)"}}]}},"results":[{"ruleId":"MD002","ruleIndex":0,"message":{"text":"MD002 - First header should be a top level header"},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"(stdin)","uriBaseId":"%SRCROOT%"},"region":{"startLine":1}}}]}]}]}
6 changes: 3 additions & 3 deletions test/test_cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def test_ignore_front_matter
#{path}/jekyll_post_2.md:16: MD001 Header levels should only increment by one level at a time
Further documentation is available for these failures:
- MD001: https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md#md001---header-levels-should-only-increment-by-one-level-at-a-time
- MD001: https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md001---header-levels-should-only-increment-by-one-level-at-a-time
OUTPUT

assert_equal(result[:stdout], expected)
Expand All @@ -258,7 +258,7 @@ def test_printing_url_links_in_tty
result = run_cli_as_tty('-r MD002', "## header2\n")

link_text = 'MD002'
url = 'https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md#md002---first-header-should-be-a-top-level-header'
url = 'https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md002---first-header-should-be-a-top-level-header'
expected_link = "\e]8;;#{url}\e\\#{link_text}\e]8;;\e\\"

expected = <<~OUTPUT
Expand All @@ -271,7 +271,7 @@ def test_printing_url_links_in_tty
def test_printing_url_links_outside_tty
result = run_cli_with_input('-r MD002', "## header2\n")

url = 'https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md#md002---first-header-should-be-a-top-level-header'
url = 'https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md002---first-header-should-be-a-top-level-header'

expected = <<~OUTPUT
(stdin):1: MD002 First header should be a top level header
Expand Down

0 comments on commit fff917c

Please sign in to comment.