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

Add pre-commit hooks #688

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/team-meeting.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ If you'd like to discuss something at the meeting, please add an item to the age

- [ ] Update dates and make sure HackMD information is correct.
- [ ] Team members add agenda items.

### After the meeting

- [ ] Turn any follow-ups into issues/comments/etc.
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create-meeting-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
# 25th day of the month, so we have a bit of lead time before the next meeting
- cron: '0 0 25 * *'
workflow_dispatch:

jobs:
create-team-issue:
runs-on: ubuntu-latest
Expand All @@ -15,4 +15,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/ISSUE_TEMPLATE/team-meeting.md
filename: .github/ISSUE_TEMPLATE/team-meeting.md
2 changes: 1 addition & 1 deletion .github/workflows/trigger-docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
# every day at 1:00
- cron: '0 1 * * *'
workflow_dispatch:


jobs:
docs:
Expand Down
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Install pre-commit hooks via
# pre-commit install

exclude: >
(?x)^(
\.vscode/settings\.json|
)$
repos:

- repo: git://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-toml
- id: check-json
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/psf/black
rev: 22.1.0
hooks:
- id: black

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.13
hooks:
- id: mdformat
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeh so you need to use this with plugins 😉 e.g.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh ok, I will try to give that a shot

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahhhh, ok I will take a look and figure it out

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meaning to circle back to mdformat-myst at some point and do some more testing/improvements.
Would be nice to advertise it on jupyter-book (but only when I'm certain it is properly working)

files: docs/*
additional_dependencies:
- mdformat-gfm
- mdformat-myst
- mdformat-black
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ help:
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

live:
sphinx-autobuild . _build/html/ --ignore */contributing.md --ignore */gallery.txt --ignore */team_panels_code.txt
sphinx-autobuild . _build/html/ --ignore */contributing.md --ignore */gallery.txt --ignore */team_panels_code.txt
2 changes: 1 addition & 1 deletion docs/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ ul.postlist > li > p:first-child {

.landing-grid .sd-card-header {
background-color: #f3772638;
}
}
26 changes: 13 additions & 13 deletions docs/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ professional computational narratives (books, lecture series, articles, etc.)
using open source tools. We want users in the scientific, academic,
and data science communities to be able to do the following:

* **Write their content in either markdown text files, or Jupyter Notebooks**.
- **Write their content in either markdown text files, or Jupyter Notebooks**.
These files include rich content - outputs from running code, references
and cross-references, equations, etc.
* **Execute content and cache the results**. Intelligent caching means
- **Execute content and cache the results**. Intelligent caching means
that only modified code cells are re-run.
* **Combine cached outputs with content files with a document model**. Using
- **Combine cached outputs with content files with a document model**. Using
the excellent [Sphinx](https://www.sphinx-doc.org/en/master/) documentation
stack, documents can include many features for publishing, such as
equations, cross-references, and citations.
* **Build interactive HTML or publication-quality PDF outputs**. Sometimes
- **Build interactive HTML or publication-quality PDF outputs**. Sometimes
users wish to create rich and interactive websites, other times they want to
send a high-quality PDF to a publisher. This system will treat both as
equal citizens.
* **Control everything above with a simple command-line interface**. Most
- **Control everything above with a simple command-line interface**. Most
users should not have to know anything about Sphinx, caching, etc. A simple
user interface will hide most of the complexity of this process.

Expand All @@ -50,28 +50,28 @@ In running this project, we aim to adhere to several principles that we believe
will result in higher-quality technology that aligns with the core principles
of the open source community. Here are a few key components:

* **Give equal support to casual users and power users**. Complicating the feature
- **Give equal support to casual users and power users**. Complicating the feature
space to support a "power user feature" should be done with great care.
* **Build modular components that are useful elsewhere**. Rather than building
- **Build modular components that are useful elsewhere**. Rather than building
a single vertical stack, find parts of the workflow that naturally separate.
Create modular tools for these parts so that they may benefit the community
outside of the context of building interactive books.
* **Use pre-existing technology where possible**. Rather than re-inventing
- **Use pre-existing technology where possible**. Rather than re-inventing
the wheel, make every effort to utilize pre-existing open source tech.
* **Use pre-existing standards where possible**. In the event that we must
- **Use pre-existing standards where possible**. In the event that we must
create new patterns of content creation or tooling, utilize prior art in
the open source community as much as possible, especially when it comes to
markup languages.
* **Contribute improvements upstream**. Where we utilize pre-existing tools,
- **Contribute improvements upstream**. Where we utilize pre-existing tools,
contribute improvements to them as we build off of them for this project.
* **Design for the future**. While we have a bit of funding now, it won't last
- **Design for the future**. While we have a bit of funding now, it won't last
forever. This means the technology should be easy for potential developers
to read, understand, and modify/improve.
* **Users should not need to know anything about the build system**. If they
- **Users should not need to know anything about the build system**. If they
want to dig into the guts of our infrastructure, they can, but knowledge
of Sphinx, Latex, and so on should not be a requirement. They should only need to
use a simple tool to control the process.
* **Don't try to do everything**. Focus our tools on publishing
- **Don't try to do everything**. Focus our tools on publishing
computational documents with reasonable choices made for the user.

Browse the rest of this site for more information about what we're working
Expand Down
2 changes: 2 additions & 0 deletions docs/communication.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This is open to anybody, and is a space where people can ask questions and help
Please feel free to provide support, advice, etc to anybody on this forum.

(comms:issues)=

## GitHub Issues

For conversations around specific actions, tasks, features, etc, we use GitHub issues in each repository.
Expand All @@ -25,6 +26,7 @@ If you'd like access, please reach out to a core team member to discuss!
## Email

% ref: https://github.com/executablebooks/meta/discussions/412 to share password/access

We have an e-mail address at `[email protected]`.
All core team members should have access to this email, though it is not currently actively monitored by the team.

Expand Down
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ def build_gallery(app: Sphinx):
)
grid_items = "\n".join(grid_items)

# :column: text-center col-6 col-lg-4
# :card: +my-2
# :img-top-cls: w-75 m-auto p-2
# :body: d-none
# :column: text-center col-6 col-lg-4
# :card: +my-2
# :img-top-cls: w-75 m-auto p-2
# :body: d-none

panels = f"""
``````{{grid}} 1 2 3 3
Expand Down
1 change: 1 addition & 0 deletions docs/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ doctree in `python`:

```python
import pickle

doc = pickle.load(open("_build/.doctrees/<file>", "rb"))
```

Expand Down
6 changes: 4 additions & 2 deletions docs/feature-vote.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
(feature-note)=

# Feature voting board

You can help us to prioritise development of new features by leaving a [👍 reaction](https://github.blog/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) on the first comment of any `enhancement` issue.

Below is a list of all current enhancement issues from our core repositories,[^a] ordered by 👍
Click the `+` to see more details.

[^a]: The data in this table is updated every day.

<div class="full-width">

```{include} issue-votes.txt
Expand All @@ -16,6 +15,7 @@ Click the `+` to see more details.
</div>

<!-- DataTables to make the table above look nice -->

<link rel="stylesheet"
href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css">
<script type="text/javascript" src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script>
Expand All @@ -27,3 +27,5 @@ $(document).ready( function () {
});
} );
</script>

[^a]: The data in this table is updated every day.
2 changes: 1 addition & 1 deletion docs/gallery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
image: https://raw.githubusercontent.com/rafneta/CienciaDatosPythonCIDE/master/docs/logo.jpg
website: https://rafneta.github.io/CienciaDatosPythonCIDE/intro.html
- name: "Development Data Partnership"
repository:
repository:
image: https://raw.githubusercontent.com/datapartnership/welcome/master/images/logo.png
website: https://docs.datapartnership.org
- name: "OpenPifPaf Guide"
Expand Down
36 changes: 20 additions & 16 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,54 @@ computational narratives using the Jupyter ecosystem.

We are the community behind [Jupyter Book](https://jupyterbook.org)--an open source project for building beautiful, publication-quality books and documents from computational material--as well as [MyST Markdown](https://myst-parser.readthedocs.io/en/latest/)--a rich and extensible flavor of Markdown meant for technical documentation and publishing.

::::{grid} 1 2 2 2
::::\{grid} 1 2 2 2
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the PR to add those plugins to our hook.

Hmm - looks like it is not picking up the colon fence syntax, is there a way to tell the pre-commit hook to re-use the same plugins that are enabled in conf.py?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah bummer - ok I'll just comment out the lines about mdformat and we can re-enable if/when there is support for extra myst extensions.

:class-container: landing-grid

:::{grid-item-card}
:::\{grid-item-card}
:padding: 2
For contributors 👩‍💻
^^^
Read our [Contributing Guide](contributing.md) to learn about the conventions we follow, and see [our community forum](https://github.com/executablebooks/meta/discussions) to ask questions and help others.
:::

:::{grid-item-card}
:::\{grid-item-card}
:padding: 2
Be inspired ✨
^^^
Our [Gallery of Jupyter Books](gallery.md) has contributions from across the community, and [our blog](updates.md) has updates from the community.
:::

:::{grid-item-card}
:::\{grid-item-card}
:padding: 2
Tools we build 👍
^^^
Our [Feature Voting board](feature-vote.md) is an easy way for community members to voice support for features and enhancements. Our [Tools Page](tools.md) also lists many of the tools we build to learn more.
:::

:::{grid-item-card}
:::\{grid-item-card}
:padding: 2
About the project ℹ️
^^^
Learn more about [our project's goals and strategy](about.md), see [a list of core team members](team.md), and see [our team meeting notes and calendar](meetings/index.md).
:::
::::


## Acknowledgements

:::{image} https://pbs.twimg.com/profile_images/1226944724365447169/MzFpwY5P_400x400.png
:::\{image} https://pbs.twimg.com/profile_images/1226944724365447169/MzFpwY5P_400x400.png
:class: float-left mr-2 rounded
:width: 100px
:::

The Executable Books Project is supported by several institutions and members of open source projects.
In particular, many thanks to the [Sloan Foundation](https://sloan.org) which [provides support for the Executable Books Project](https://sloan.org/grant-detail/9231).


```{toctree}
:maxdepth: 2
:caption: Get Involved
:hidden:
---
maxdepth: 2
caption: Get Involved
hidden:
---
contributing.md
developer.md
resources.md
Expand All @@ -63,17 +63,21 @@ meetings/index.md
```

```{toctree}
:hidden:
:caption: Our Projects and Tools
---
hidden:
caption: Our Projects and Tools
---
feature-vote.md
gallery.md
tools.md
```

```{toctree}
:maxdepth: 2
:caption: About the Project
:hidden:
---
maxdepth: 2
caption: About the Project
hidden:
---
about.md
team.md
updates.md
Expand Down
Loading