Skip to content

Commit

Permalink
Pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Ingram committed Feb 10, 2022
1 parent 8a1790d commit 5edfe3c
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 15 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ the need of having a separate files for view functions and templates. It tries
to embrace [Locality of Behaviour](https://htmx.org/essays/locality-of-behaviour/)
by putting the view function code and template in the same file, and having the
file's path be the route used by Starlette to access the code.

4 changes: 2 additions & 2 deletions docs/cli.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Dark Star CLI

Dark Star comes with a CLI that helps you perform basic tasks.
Dark Star comes with a CLI that helps you perform basic tasks.

Run it using the command `darkstar`.

```sh
$ darkstar
$ darkstar
Usage: cli [OPTIONS] COMMAND [ARGS]...

Dark Star - a web framework based on Starlette
Expand Down
1 change: 0 additions & 1 deletion docs/htmx.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ request is not from htmx.

...
"""

2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ routes/
index.py # The root template - inherited by other templates
users.py # A template file that maps to the /users/ url
users/
{profile}.py # A template that maps to the /user/{profile}/ url
{profile}.py # A template that maps to the /user/{profile}/ url
# and lets the code access the value of `profile`
```
## Example Template File
Expand Down
2 changes: 1 addition & 1 deletion docs/routes.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Will get converted into the following function:

The function's name is based off a hash of the file path, and so should be considered random to all intents and purposes.

The return value is added to the end of all functions, so it is important that a template also be defined in the file. Templates are defined by adding a triple-quoted string to the end of the file.
The return value is added to the end of all functions, so it is important that a template also be defined in the file. Templates are defined by adding a triple-quoted string to the end of the file.

For example:

Expand Down
5 changes: 3 additions & 2 deletions src/darkstar/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import click
from pathlib import Path
from starlette.routing import compile_path

import click
from jinja2 import Template
from starlette.routing import compile_path

APP_TEMPLATE = """\
from darkstar.applications import DarkStar
Expand Down
5 changes: 3 additions & 2 deletions src/darkstar/applications.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import ast
from hashlib import md5
from pathlib import Path
from tokenize import tokenize, COMMENT
from io import BytesIO
from pathlib import Path
import shlex
from tokenize import COMMENT
from tokenize import tokenize
import typing

from starlette.applications import Starlette
Expand Down
9 changes: 4 additions & 5 deletions test_ast.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from shlex import split

import ast
from io import BytesIO
from shlex import split
from tokenize import COMMENT
from tokenize import tokenize

from astpretty import pprint
from tokenize import tokenize, COMMENT

from io import BytesIO

code1 = """
print(2)
Expand Down

0 comments on commit 5edfe3c

Please sign in to comment.