Skip to content

Commit

Permalink
Merge ddd0081 into e58710c
Browse files Browse the repository at this point in the history
  • Loading branch information
lyz-code committed Dec 27, 2022
2 parents e58710c + ddd0081 commit 4406a68
Show file tree
Hide file tree
Showing 9 changed files with 744 additions and 743 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
@@ -1,6 +1,6 @@
{
"template": "https://github.com/lyz-code/cookiecutter-python-project",
"commit": "12cbe8c2e067d360e00083af8e3de8fa20170481",
"commit": "e246eb174b7bf34c301c0f5cfa69bf5837514e7b",
"context": {
"cookiecutter": {
"project_name": "yamlfix",
Expand Down
15 changes: 11 additions & 4 deletions .github/workflows/tests.yml
Expand Up @@ -3,8 +3,7 @@ name: Tests

on: # yamllint disable-line rule:truthy
push:
branches:
- main
branches: [main]
pull_request:
types: [opened, synchronize]
workflow_dispatch:
Expand Down Expand Up @@ -32,12 +31,20 @@ jobs:
source .venv/bin/activate
pdm config python.use_venv True
make install
# 3.7 is giving me some issues with flake8 and importlib-metadata, until
# https://github.com/flakeheaven/flakeheaven/issues/132 is done, I won't spend
# time testing in this environment.
# https://github.com/lyz-code/mkdocs-newsletter/actions/runs/3548202587/jobs/5959150030
- name: Test linters
run: make lint
run: if [[ ${{ matrix.python-version }} != '3.7' ]];then make lint; fi
- name: Test type checkers
run: make mypy
# 3.7 is giving me some issues with flake8 and importlib-metadata, until
# https://github.com/flakeheaven/flakeheaven/issues/132 is done, I won't spend
# time testing in this environment.
# https://github.com/lyz-code/mkdocs-newsletter/actions/runs/3548202587/jobs/5959150030
- name: Test security
run: make security
run: if [[ ${{ matrix.python-version }} != '3.7' ]];then make security; fi
- name: Test with pytest
run: make test
- name: Upload Coverage
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Expand Up @@ -13,7 +13,7 @@ update:
@echo "- Updating dependencies -"
@echo "-------------------------"

pdm update --no-sync
pdm update --no-sync --update-eager
pdm sync --clean

@echo "\a"
Expand All @@ -24,7 +24,7 @@ update-production:
@echo "- Updating production dependencies -"
@echo "------------------------------------"

pdm update --production --no-sync
pdm update --production --no-sync --update-eager
pdm sync --clean

@echo "\a"
Expand Down Expand Up @@ -115,6 +115,7 @@ clean:
rm -f `find . -type f -name '*.py[co]' `
rm -f `find . -type f -name '*.rej' `
rm -rf `find . -type d -name '*.egg-info' `
rm -rf `find . -type d -name '.mypy_cache' `
rm -f `find . -type f -name '*~' `
rm -f `find . -type f -name '.*~' `
rm -rf .cache
Expand Down
149 changes: 79 additions & 70 deletions docs/contributing.md
@@ -1,24 +1,24 @@
So you've started using `yamlfix` and want to show your gratitude to the project,
depending on your programming skills there are different ways to do so.
So you've started using `yamlfix` and want to show your gratitude to the
project, depending on your programming skills there are different ways to do so.

# I don't know how to program

There are several ways you can contribute:

* [Open an issue](https://github.com/lyz-code/yamlfix/issues/new) if you encounter
any bug or to let us know if you want a new feature to be implemented.
* Spread the word about the program.
* Review the [documentation](https://lyz-code.github.io/yamlfix) and try to improve
it.
- [Open an issue](https://github.com/lyz-code/yamlfix/issues/new) if you
encounter any bug or to let us know if you want a new feature to be
implemented.
- Spread the word about the program.
- Review the [documentation](https://lyz-code.github.io/yamlfix) and try to
improve it.

# I know how to program in Python

If you have some python knowledge there are some additional ways to contribute.
We've ordered the [issues](https://github.com/lyz-code/yamlfix/issues) in
[milestones](https://github.com/lyz-code/yamlfix/milestones), check the issues in
the smaller one, as it's where we'll be spending most of our efforts. Try the
[good first
issues](https://github.com/lyz-code/yamlfix/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22),
[milestones](https://github.com/lyz-code/yamlfix/milestones), check the issues
in the smaller one, as it's where we'll be spending most of our efforts. Try the
[good first issues](https://github.com/lyz-code/yamlfix/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22),
as they are expected to be easier to get into the project.

We develop the program with
Expand All @@ -27,20 +27,22 @@ contribution to have it's associated tests. We also try to maintain an updated
[documentation](https://lyz-code.github.io/yamlfix) of the project, so think if
your contribution needs to update it.

We know that the expected code quality is above average. Therefore it might
be changeling to get the initial grasp of the project structure, know how to make the
tests, update the documentation or use all the project technology stack. but please
don't let this fact discourage you from contributing:
We know that the expected code quality is above average. Therefore it might be
changeling to get the initial grasp of the project structure, know how to make
the tests, update the documentation or use all the project technology stack. but
please don't let this fact discourage you from contributing:

* If you want to develop a new feature, explain how you'd like to do it in the related issue.
* If you don't know how to test your code, do the pull request without the tests
and we'll try to do them for you.
- If you want to develop a new feature, explain how you'd like to do it in the
related issue.
- If you don't know how to test your code, do the pull request without the tests
and we'll try to do them for you.

# Issues

Questions, feature requests and bug reports are all welcome as issues.
**To report a security vulnerability, please see our [security
policy](https://github.com/lyz-code/yamlfix/security/policy) instead.**
Questions, feature requests and bug reports are all welcome as issues. **To
report a security vulnerability, please see our
[security policy](https://github.com/lyz-code/yamlfix/security/policy)
instead.**

To make it as simple as possible for us to help you, please include the output
of the following call in your issue:
Expand All @@ -51,20 +53,20 @@ python -c "import yamlfix.version; print(yamlfix.version.version_info())"

or if you have `make` installed, you can use `make version`.

Please try to always include the above unless you're unable to install `yamlfix` or know it's not relevant to your question or
feature request.
Please try to always include the above unless you're unable to install `yamlfix`
or know it's not relevant to your question or feature request.

# Pull Requests

*yamlfix* is released regularly so you should see your
improvements release in a matter of days or weeks.
*yamlfix* is released regularly so you should see your improvements release in a
matter of days or weeks.

!!! note
Unless your change is trivial (typo, docs tweak etc.), please create an
issue to discuss the change before creating a pull request.

If you're looking for something to get your teeth into, check out the ["help
wanted"](https://github.com/lyz-code/yamlfix/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
If you're looking for something to get your teeth into, check out the
["help wanted"](https://github.com/lyz-code/yamlfix/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22)
label on github.

# Development facilities
Expand All @@ -78,65 +80,72 @@ linting locally.

You'll need to have python 3.7 or 3.8, virtualenv, git, and make installed.

* Clone your fork and go into the repository directory:
- Clone your fork and go into the repository directory:

```bash
git clone git@github.com:<your username>/yamlfix.git
cd yamlfix
```
```bash
git clone git@github.com:<your username>/yamlfix.git
cd yamlfix
```

* Set up the virtualenv for running tests:
- Set up the virtualenv for running tests:

```bash
virtualenv -p `which python3.7` env
source env/bin/activate
```
```bash
virtualenv -p `which python3.7` env
source env/bin/activate
```

* Install yamlfix, dependencies and configure the
pre-commits:
- Install `pdm` our package manager with the next command or using any of the
other
[recommended methods](https://pdm.fming.dev/latest/#recommended-installation-method).

```bash
make install
```
```bash
curl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py | python3 -
```

* Checkout a new branch and make your changes:
- Install yamlfix, dependencies and configure the pre-commits:

```bash
git checkout -b my-new-feature-branch
```
```bash
make install
```

* Fix formatting and imports: yamlfix uses
[black](https://github.com/ambv/black) to enforce formatting and
[isort](https://github.com/timothycrosley/isort) to fix imports.
- Checkout a new branch and make your changes:

```bash
make format
```
```bash
git checkout -b my-new-feature-branch
```

* Run tests and linting:
- Fix formatting and imports: yamlfix uses
[black](https://github.com/ambv/black) to enforce formatting and
[isort](https://github.com/timothycrosley/isort) to fix imports.

```bash
make
```
```bash
make format
```

There are more sub-commands in Makefile like `test-code`, `test-examples`,
`mypy` or `security` which you might want to use, but generally `make`
should be all you need.
- Run tests and linting:

If you need to pass specific arguments to pytest use the `ARGS` variable,
for example `make test ARGS='-k test_markdownlint_passes'`.
```bash
make
```

* Build documentation: If you have changed the documentation, make sure it
builds the static site. Once built it will serve the documentation at
`localhost:8000`:
There are more sub-commands in Makefile like `test-code`, `test-examples`,
`mypy` or `security` which you might want to use, but generally `make` should
be all you need.

```bash
make docs
```
If you need to pass specific arguments to pytest use the `ARGS` variable, for
example `make test ARGS='-k test_markdownlint_passes'`.

* Commit, push, and create your pull request.
- Build documentation: If you have changed the documentation, make sure it
builds the static site. Once built it will serve the documentation at
`localhost:8000`:

* Make a new release: To generate the changelog of the new changes, build the
package, upload to pypi and clean the build files use `make bump`.
```bash
make docs
```

- Commit, push, and create your pull request.

- Make a new release: To generate the changelog of the new changes, build the
package, upload to pypi and clean the build files use `make bump`.

We'd love you to contribute to *yamlfix*!
8 changes: 3 additions & 5 deletions mkdocs.yml
Expand Up @@ -16,8 +16,7 @@ plugins:
rendering:
show_root_heading: true
heading_level: 1
watch:
- src
watch: [src]
- autolinks
- git-revision-date-localized:
type: timeago
Expand Down Expand Up @@ -66,16 +65,15 @@ theme:
# logo: 'images/logo.bmp'
features:
- navigation.instant
- navigation.footer
- navigation.top
- content.code.annotate

palette:
primary: blue grey
accent: light blue

extra_css:
- stylesheets/extra.css
- stylesheets/links.css
extra_css: [stylesheets/extra.css, stylesheets/links.css]

repo_name: lyz-code/yamlfix
repo_url: https://github.com/lyz-code/yamlfix

0 comments on commit 4406a68

Please sign in to comment.