Skip to content

Commit

Permalink
Run linter
Browse files Browse the repository at this point in the history
  • Loading branch information
nabobalis committed Jan 7, 2024
1 parent fe5cccb commit fa1b21a
Show file tree
Hide file tree
Showing 45 changed files with 1,009 additions and 1,138 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ version: 2
jobs:
twine-check:
docker:
- image: circleci/python:3.8
- image: circleci/python:3.11
steps:
- checkout
- run: python setup.py sdist
- run: python -m pip install -U --user --force-reinstall twine
- run: python -m pip install -U --user build
- run: python -m build . --sdist
- run: python -m pip install -U --user twine
- run: python -m twine check dist/*

workflows:
version: 2
twine-check:
Expand Down
10 changes: 0 additions & 10 deletions .djlintrc

This file was deleted.

30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ name: CI
on:
push:
branches:
- 'main'
- '*.*'
- '!*backport*'
- "main"
- "*.*"
- "!*backport*"
tags:
- 'v*'
- '!*dev*'
- '!*pre*'
- '!*post*'
- "v*"
- "!*dev*"
- "!*pre*"
- "!*post*"
pull_request:
workflow_dispatch:
schedule:
# ┌───────── minute (0 - 59)
# │ ┌───────── hour (0 - 23)
# │ │ ┌───────── day of the month (1 - 31)
# │ │ │ ┌───────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT)
- cron: '0 7 * * *' # Every day at 07:00 UTC
# ┌───────── minute (0 - 59)
# │ ┌───────── hour (0 - 23)
# │ │ ┌───────── day of the month (1 - 31)
# │ │ │ ┌───────── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌───────── day of the week (0 - 6 or SUN-SAT)
- cron: "0 7 * * *" # Every day at 07:00 UTC

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
needs: [test]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main
with:
default_python: '3.9'
default_python: "3.9"
submodules: false
pytest: false
envs: |
Expand All @@ -77,7 +77,7 @@ jobs:
needs: [test]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main
with:
default_python: '3.9'
default_python: "3.9"
submodules: false
coverage: codecov
libraries: |
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -U --user --force-reinstall pep517 setuptools_scm twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m pep517.build --binary --source --out-dir wheelhouse .
python -m twine upload --skip-existing wheelhouse/*
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -U --user --force-reinstall pep517 setuptools_scm twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m pep517.build --binary --source --out-dir wheelhouse .
python -m twine upload --skip-existing wheelhouse/*
55 changes: 29 additions & 26 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ci:
autofix_prs: false
autoupdate_schedule: "quarterly"
autofix_prs: false
autoupdate_schedule: "quarterly"
repos:
- repo: https://github.com/myint/docformatter
rev: v1.7.5
Expand All @@ -11,26 +11,28 @@ repos:
rev: v2.2.1
hooks:
- id: autoflake
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']
exclude: ".*(.fits|.fts|.fit|.txt|tca.*|extern.*|.rst|.md|docs/conf.py)$"
args:
[
"--in-place",
"--remove-all-unused-imports",
"--remove-unused-variable",
]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.1.11'
rev: "v0.1.11"
hooks:
- id: ruff
args: ['--fix', '--unsafe-fixes']
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
args: ["--fix", "--unsafe-fixes"]
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
- id: black
exclude: ".*(.fits|.fts|.fit|.txt|.csv)$"
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
exclude: ".*(.fits|.fts|.fit|.txt|.csv)$"
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-ast
- id: check-case-conflict
- id: trailing-whitespace
Expand All @@ -48,17 +50,18 @@ repos:
additional_dependencies:
- tomli
- repo: https://github.com/awebdeveloper/pre-commit-stylelint
rev: '0.0.2'
rev: "0.0.2"
hooks:
- id: stylelint
additional_dependencies:
["stylelint@14.9.1", "stylelint-config-standard@26.0.0"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: stylelint
additional_dependencies: ['stylelint@14.9.1', 'stylelint-config-standard@26.0.0']
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [css, scss, javascript]
- id: prettier
exclude_types: [html]
- repo: https://github.com/Riverside-Healthcare/djLint
rev: v1.34.1
hooks:
- id: djlint-jinja
types_or: ["html"]
types: [html]
8 changes: 4 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ sphinx:
configuration: docs/conf.py
fail_on_warning: false
python:
install:
- method: pip
extra_requirements:
install:
- method: pip
extra_requirements:
- all
- docs
path: .
path: .
2 changes: 1 addition & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"extends": "stylelint-config-standard"
"extends": "stylelint-config-standard"
}
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

version = str(_parse(ablog.__version__))
project = "ABlog"
copyright = "2014-2022, ABlog Team"
copyright = "2014-2022, ABlog Team" # NOQA: A001
master_doc = "index"
source_suffix = {
".rst": "restructuredtext",
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Once you have content (in ``.rst`` files), you can post *any page* using the :rs
:location: SF
:language: en
An alterative method is:
An alternative method is:

.. code-block:: rst
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/ablog-commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Running ``ablog deploy`` will push your website to GitHub::
`conf.py`
-g GITHUB_PAGES GitHub username for deploying to GitHub pages
-m MESSAGE commit message
-f owerwrite last commit, i.e. `commit --amend; push -f`
-f overwrite last commit, i.e. `commit --amend; push -f`
--push-quietly be more quiet when pushing changes
--github-branch GITHUB_BRANCH
Branch to use. Default is 'master'.
Expand Down
6 changes: 4 additions & 2 deletions docs/manual/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This page is a markdown file underneath.
You will need to do a few things to get setup.

1. Install [myst-parser](https://pypi.org/project/myst-parser/)
2. Add these options to your config, ``conf.py``
2. Add these options to your config, `conf.py`

```python
extensions = [
Expand All @@ -27,6 +27,7 @@ myst_update_mathjax = False
```

Then use the new blogpost metadata format (with a slight twist):

```
---
blogpost: true
Expand All @@ -41,7 +42,8 @@ language: English
Notice here we do not have a ":" at the start since the markdown metadata format is different from rst.

Please be aware that adding "myst-parser" will mean it will read all markdown files and try to parse them.
You will need to use the following in your ``conf.py`` to prevent this:
You will need to use the following in your `conf.py` to prevent this:

```python
exclude_patterns = [
"posts/*/.ipynb_checkpoints/*",
Expand Down
2 changes: 1 addition & 1 deletion docs/manual/notebook_support.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"To add support for Notebooks to your Ablog instance, you need to configure your `docs/conf.py` (or whereever your `conf.py` is located.\n",
"To add support for Notebooks to your Ablog instance, you need to configure your `docs/conf.py` (or wherever your `conf.py` is located.\n",
"\n",
"You will need to add\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/release/ablog-v0.10-released.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ ABlog v0.10.20 released
Pull Requests merged in:

`fix documentation typo in blog-drafts <https://github.com/sunpy/ablog/pull/105>`__.
`Fix typo in "extennsion" <https://github.com/sunpy/ablog/pull/109>`__.
`Fix typo in "extension" <https://github.com/sunpy/ablog/pull/109>`__.
`Catalan translation <https://github.com/sunpy/ablog/pull/113>`__.
`Fix ablog post <https://github.com/sunpy/ablog/pull/114>`__.

Expand Down
Loading

0 comments on commit fa1b21a

Please sign in to comment.