Skip to content

Commit

Permalink
Add useful options to prettier (#356)
Browse files Browse the repository at this point in the history
Have added the flags and just ran over the repo - no manual changes
  • Loading branch information
paddyroddy authored Apr 17, 2024
1 parent e8dc0fd commit 9003540
Show file tree
Hide file tree
Showing 27 changed files with 616 additions and 574 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ body:
attributes:
label: Actual Behaviour
description: >-
Be a specific and detailed as you can.
Paste any output or stack traces of errors you receive.
Be a specific and detailed as you can. Paste any output or stack traces
of errors you receive.
validations:
required: true
# - id: version
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ body:
attributes:
label: How to Improve This Section
description: >-
Do you have any specific suggestions we
could take to improve the documentation?
Do you have any specific suggestions we could take to improve the
documentation?
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ body:
attributes:
label: Describe Alternatives You've Considered
description: >-
A clear and concise description of any alternative
solutions or features you've considered.
A clear and concise description of any alternative solutions or features
you've considered.
- id: additional
type: textarea
attributes:
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ body:
attributes:
label: How to Improve This Section
description: >-
Do you have any specific suggestions we
could take to improve the website?
Do you have any specific suggestions we could take to improve the
website?
4 changes: 3 additions & 1 deletion .github/workflows/links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ jobs:
# the whole of the project slug README since the links are
# necessarily not real links - i.e. demos and to be filled by
# cookiecutter values.
args: "--verbose --exclude https://forum.image.sc/ --exclude docs/pages --exclude-path '{{cookiecutter.project_slug}}/README.md' -- ."
args:
"--verbose --exclude https://forum.image.sc/ --exclude docs/pages
--exclude-path '{{cookiecutter.project_slug}}/README.md' -- ."
fail: true
jobSummary: true
env:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ jobs:
- name: Build with Jekyll
working-directory: docs
# Outputs to the './_site' directory by default
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
run:
bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path
}}"
env:
JEKYLL_ENV: production
- name: Upload artifact
Expand Down
3 changes: 3 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ repos:
rev: v3.1.0
hooks:
- id: prettier
args:
- --prose-wrap=always
- --quote-props=as-needed
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand Down
36 changes: 18 additions & 18 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
nationality, personal appearance, race, religion, or sexual identity and
orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
Expand All @@ -22,17 +22,17 @@ community include:
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
- Focusing on what is best not just for us as individuals, but for the
overall community
- Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behaviour include:

- The use of sexualized language or imagery, and sexual attention or
advances of any kind
- The use of sexualized language or imagery, and sexual attention or advances of
any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email
address, without their explicit permission
- Publishing others' private information, such as a physical or email address,
without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

Expand Down Expand Up @@ -60,8 +60,8 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behaviour may be
reported to the community leaders responsible for enforcement at
<arc.collaborations@ucl.ac.uk>.
All complaints will be reviewed and investigated promptly and fairly.
<arc.collaborations@ucl.ac.uk>. All complaints will be reviewed and investigated
promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
Expand All @@ -82,15 +82,15 @@ behaviour was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.
**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behaviour. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

Expand All @@ -109,17 +109,17 @@ Violating these terms may lead to a permanent ban.
standards, including sustained inappropriate behaviour, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.
**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
<https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ put you off creating an issue.
To contribute a change, please:

1. Create a new branch (or fork if you're not in [@UCL-ARC/collaborations]).
2. Modify an existing page, create a new one, or tweak the template.
a. Run [pre-commit](https://pre-commit.com) which will lint your changes.
b. Check the tests pass if you modified the template (`pytest -s`).
2. Modify an existing page, create a new one, or tweak the template. a. Run
[pre-commit](https://pre-commit.com) which will lint your changes. b. Check
the tests pass if you modified the template (`pytest -s`).
3. Open a _pull request_ (PR) with changes.
4. Ask someone who did not contribute to the PR from [@UCL-ARC/collaborations]
to review it.
Expand Down
23 changes: 11 additions & 12 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@

Copyright (c) 2023-2024 UCL Centre for Advanced Research Computing

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 changes: 14 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ This repository collects the [UCL ARC] recommendations for a research software
project in Python. It contains a template for new Python packages and a
[website] documenting our recommendations. We've turned on
[discussions](https://github.com/UCL-ARC/python-tooling/discussions) for this
repo, and we welcome questions there or in the `#helpme` channel on
the [UCL research programming hub Slack](https://www.ucl.ac.uk/advanced-research-computing/community/ucl-research-programming-hub).
repo, and we welcome questions there or in the `#helpme` channel on the
[UCL research programming hub Slack](https://www.ucl.ac.uk/advanced-research-computing/community/ucl-research-programming-hub).

🍪 Our template is a [cookiecutter] template which automatically creates new
Python packages with our recommended tooling set up and ready to go.

> **Note**
> If you're making a package within a community that has an existing package
> template (e.g., [`scikit-hep`](https://github.com/scikit-hep/cookie)), we
> recommend using their template instead of this one.
> **Note** If you're making a package within a community that has an existing
> package template (e.g., [`scikit-hep`](https://github.com/scikit-hep/cookie)),
> we recommend using their template instead of this one.
<!-- links here -->

Expand All @@ -28,8 +27,8 @@ Python packages with our recommended tooling set up and ready to go.

## Using this template

1. Install [cookiecutter] in a Conda or `venv` environment
(commented lines for Conda example).
1. Install [cookiecutter] in a Conda or `venv` environment (commented lines for
Conda example).

```
# conda create --channel conda-forge --name new-env-name
Expand Down Expand Up @@ -127,9 +126,8 @@ cd python-tooling
conda remove -n ptoolingVE --all
```
- To run template in the same path of this repo.
We do a test cookiecut of a dummy package and install it to ensure the
template setup works.
- To run template in the same path of this repo. We do a test cookiecut of a
dummy package and install it to ensure the template setup works.
```
cookiecutter .
Expand Down Expand Up @@ -159,11 +157,12 @@ sub-directory, and are written in markdown.
To build the webpage locally (for testing)
1. [Install jekyll](https://jekyllrb.com/docs/installation)
2. Run `bundle install` from the `docs/` directory of this repository to install dependencies.
2. Run `bundle install` from the `docs/` directory of this repository to
install dependencies.
3. Run `bundle exec jekyll serve` from the root directory of this repository.
This should fire up a local web server and tell you its address. By default the
server will automatically refresh the HTML pages if any changes are made to the
markdown sources.
This should fire up a local web server and tell you its address. By default
the server will automatically refresh the HTML pages if any changes are made
to the markdown sources.
See the [jekyll docs](https://jekyllrb.com/docs) for more info.
Expand Down
3 changes: 2 additions & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
title: UCL ARC Python tooling
description: Common Python tooling used in UCL's Advanced Research Computing center
description:
Common Python tooling used in UCL's Advanced Research Computing center
theme: just-the-docs

url: https://UCL-ARC.github.io/python-tooling
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ makes it easier for others in the community to contribute to your package. Once
_you_ get used to the structure makes it easier for you to contribute back to
other packages.

If you just want to get started with our recommendations, we have [our own
Python package template](https://github.com/UCL-ARC/python-tooling#using-this-template) that
lives in the same repository as these pages.
If you just want to get started with our recommendations, we have
[our own Python package template](https://github.com/UCL-ARC/python-tooling#using-this-template)
that lives in the same repository as these pages.

Otherwise, each page on this site highlights recommended packages or services
for each area. These should not be taken as set in stone for every project, but
Expand Down
7 changes: 4 additions & 3 deletions docs/pages/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ We have many projects using GitHub CI and, it has good integration with GitHub i

# Coverage monitoring

These services report and track test code coverage over time.
They render the code with highlighting to show which lines are not executed by tests.
See [testing](testing) for our recommendations on packages to generate code coverage during tests.
These services report and track test code coverage over time. They render the
code with highlighting to show which lines are not executed by tests. See
[testing](testing) for our recommendations on packages to generate code coverage
during tests.

| Name | Short description | 🚦 |
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-: |
Expand Down
9 changes: 5 additions & 4 deletions docs/pages/community.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ layout: default

# Community building

There are many platforms to build a community for users and developers.
We recommend you choose one, and not more than one.
If you are creating a new space, you should consider joining an existing community space.
Common topics discussed in these communities can be developers meetings, ideas for new directions, and general help and support for users.
There are many platforms to build a community for users and developers. We
recommend you choose one, and not more than one. If you are creating a new
space, you should consider joining an existing community space. Common topics
discussed in these communities can be developers meetings, ideas for new
directions, and general help and support for users.

| Name | Short description | 🚦 |
| ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-: |
Expand Down
27 changes: 15 additions & 12 deletions docs/pages/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ With Python, as with many other languages, it's very common to automatically
create a web page with documentation. This can include reference for the API
taken from your package's [docstrings], tutorials, examples, and more in depth
explanation about how the package works. For an in-depth discussion of the
different components of good documentation, see the [Diátaxis
framework](https://diataxis.fr/). For your package to be easily reusable we
recommend you build documentation pages and host them somewhere.
different components of good documentation, see the
[Diátaxis framework](https://diataxis.fr/). For your package to be easily
reusable we recommend you build documentation pages and host them somewhere.

If you're using GitHub, one option is to host your docs on [GitHub pages].
[Here's how we've set this up][template-docs-dot-yaml] for [our template].
Expand All @@ -20,8 +20,10 @@ If you're using GitHub, one option is to host your docs on [GitHub pages].

[docstrings]: https://peps.python.org/pep-0257/#what-is-a-docstring
[GitHub pages]: https://docs.github.com/en/pages
[our template]: https://github.com/UCL-ARC/python-tooling?tab=readme-ov-file#using-this-template
[template-docs-dot-yaml]: https://github.com/UCL-ARC/python-tooling/blob/main/%7B%7Bcookiecutter.project_slug%7D%7D/.github/workflows/docs.yml
[our template]:
https://github.com/UCL-ARC/python-tooling?tab=readme-ov-file#using-this-template
[template-docs-dot-yaml]:
https://github.com/UCL-ARC/python-tooling/blob/main/%7B%7Bcookiecutter.project_slug%7D%7D/.github/workflows/docs.yml

## Documentation build tools

Expand All @@ -38,16 +40,17 @@ If you're using GitHub, one option is to host your docs on [GitHub pages].
We marginally recommend [MkDocs] over [Sphinx] due to it's ease of use,
preference for Markdown, and more support for a variety of docstring styles.

However the [Sphinx] tool has long been the de-facto standard in the scientific Python ecosystem. It is widely
used, customisable, and well tested. If you need a [Sphinx
extension](#sphinx-extensions) that does not have an equivalent [MkDocs
plugin](https://github.com/mkdocs/catalog), or if you are part of a community
that heavily uses [Sphinx] then we recommend you use that
instead.
However the [Sphinx] tool has long been the de-facto standard in the scientific
Python ecosystem. It is widely used, customisable, and well tested. If you need
a [Sphinx extension](#sphinx-extensions) that does not have an equivalent
[MkDocs plugin](https://github.com/mkdocs/catalog), or if you are part of a
community that heavily uses [Sphinx] then we recommend you use that instead.

### See also

- Our internal discussions about which to recommend ([#16](https://github.com/UCL-ARC/python-tooling/issues/16) and [#187](https://github.com/UCL-ARC/python-tooling/issues/187)).
- Our internal discussions about which to recommend
([#16](https://github.com/UCL-ARC/python-tooling/issues/16) and
[#187](https://github.com/UCL-ARC/python-tooling/issues/187)).
- [An interesting related discussion](https://github.com/encode/httpx/discussions/1220).

</details>
Expand Down
Loading

0 comments on commit 9003540

Please sign in to comment.