Skip to content

maint: Add markdownlint pre-commit hook #3756

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

Merged
merged 5 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Default state for all rules
default: true

# MD013/line-length - Line length
MD013:
# Number of characters
line_length: 200

no-duplicate-heading: false
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ repos:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/DavidAnson/markdownlint-cli2
rev: v0.17.1
hooks:
- id: markdownlint-cli2
args: [--fix]
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.1
hooks:
Expand Down
2,370 changes: 1,186 additions & 1,184 deletions CHANGELOG.md

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Mamba: The Fast Cross-Platform Package Manager

![mamba header image](docs/assets/mamba_header.png)

## The Fast Cross-Platform Package Manager
<!-- markdownlint-disable-file MD033 -->

<table>
<thead align="center" cellspacing="10">
Expand All @@ -16,7 +18,7 @@
</tbody>
</table>

# mamba
## mamba

[![Build Status](https://github.com/mamba-org/mamba/actions/workflows/tests.yml/badge.svg)](https://github.com/mamba-org/mamba/actions/workflows/tests.yml?query=branch%3Amain)
[![Join the Gitter Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mamba-org/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
Expand Down Expand Up @@ -59,7 +61,8 @@ See the [documentation on `micromamba`](https://mamba.readthedocs.io/en/latest/u

## Installation

Please refer to the [mamba](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html) and [micromamba](https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html) installation guide in the documentation.
Please refer to the [mamba](https://mamba.readthedocs.io/en/latest/installation/mamba-installation.html)
and [micromamba](https://mamba.readthedocs.io/en/latest/installation/micromamba-installation.html) installation guide in the documentation.

## Additional features in Mamba and Micromamba

Expand Down Expand Up @@ -96,7 +99,7 @@ It can significantly reduce your CI setup time by:

While `mamba` and `micromamba` are generally a drop-in replacement for `conda` there are some differences:

- `mamba` and `micromamba` do no support revisions (for discussions, see https://github.com/mamba-org/mamba/issues/803)
- `mamba` and `micromamba` do no support revisions (for discussions, see <https://github.com/mamba-org/mamba/issues/803>)
- `mamba` and `micromamba` normalize `MatchSpec` strings to the simplest form, whereas `conda` use a more verbose form
This can lead to slight differences in the output of `conda env export` and `mamba env export`.

Expand All @@ -110,7 +113,8 @@ Only `mamba` and `micromamba` 2.0 and later are supported and are actively devel

The `1.x` branch is only maintained for addressing security issues such as CVEs.

For questions, you can also join us on the [QuantStack Chat](https://gitter.im/QuantStack/Lobby) or on the [Conda channel](https://gitter.im/conda/conda) (note that this project is not officially affiliated with `conda` or Anaconda Inc.).
For questions, you can also join us on the [QuantStack Chat](https://gitter.im/QuantStack/Lobby)
or on the [Conda channel](https://gitter.im/conda/conda) (note that this project is not officially affiliated with `conda` or Anaconda Inc.).

## License

Expand Down
2,146 changes: 1,074 additions & 1,072 deletions libmamba/CHANGELOG.md

Large diffs are not rendered by default.

1,148 changes: 575 additions & 573 deletions libmambapy/CHANGELOG.md

Large diffs are not rendered by default.

1,472 changes: 737 additions & 735 deletions micromamba/CHANGELOG.md

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion micromamba/tests/pre_commit_conda_hooks_repo/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Copied from https://github.com/pre-commit/pre-commit/tree/main/testing/resources/conda_hooks_repo
# conda_hooks_repo

Copied from <https://github.com/pre-commit/pre-commit>
Was deleted in <https://github.com/pre-commit/pre-commit/commit/f1b5f6637481704b687b2f3bbda49500af7849c1>

Copyright (c) 2014 pre-commit dev team: Anthony Sottile, Ken Struys
MIT license
8 changes: 4 additions & 4 deletions releaser.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def template_substitute(contents):
today = datetime.date.today()
fmt_today = today.strftime("%B %d, %Y")

res += f"# {name} {version} ({fmt_today})\n\n"
res += f"## {name} {version} ({fmt_today})\n\n"

for idx, c in enumerate(changes):
if c.startswith("-"):
Expand Down Expand Up @@ -115,7 +115,7 @@ def applies(x):
el["changes"].append(f"- {i.text.strip()}")


MARKDOWN_H1 = "# "
MARKDOWN_H2 = "## "


def main():
Expand All @@ -124,7 +124,7 @@ def main():
contents = fi.readlines()

for idx, line in enumerate(contents):
if line.startswith(MARKDOWN_H1):
if line.startswith(MARKDOWN_H2):
release_start = idx + 1
break

Expand Down Expand Up @@ -154,7 +154,7 @@ def main():
changes[project]["version"] = release_version
continue

if contents[idx + 1].startswith(MARKDOWN_H1):
if contents[idx + 1].startswith(MARKDOWN_H2):
break

if line.strip() == "" or line[0] == "-":
Expand Down
4 changes: 2 additions & 2 deletions update_changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def append_to_file(ctgr_name, prs, out_file):
concerned_pkgs = ["all/"]
# Write in file
out_file.write(
"- [{}] {} by @{} in {}\n".format(
"- [{}] {} by @{} in <{}>\n".format(
(", ".join([pkg[:-1] for pkg in concerned_pkgs])), title, author_login, url
)
)
Expand Down Expand Up @@ -166,7 +166,7 @@ def main():

# Append new info
# Release date and version
changelog_file.write("# {}\n".format(date.today().strftime("%Y.%m.%d")))
changelog_file.write("## {}\n".format(date.today().strftime("%Y.%m.%d")))
changelog_file.write(
f"\nRelease: {release_version} (libmamba, mamba, micromamba, libmambapy)\n"
)
Expand Down
Loading