Skip to content

Commit

Permalink
precommit formatters
Browse files Browse the repository at this point in the history
  • Loading branch information
olirice committed Sep 2, 2021
1 parent f2c11cf commit 3ab79c8
Show file tree
Hide file tree
Showing 11 changed files with 415 additions and 397 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
BasedOnStyle: LLVM
BasedOnStyle: LLVM
IndentWidth: 4

BinPackArguments: false
Expand Down
39 changes: 39 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
exclude: ^src/test/resources/.*\.(htm|txt)$
- id: check-yaml
- id: check-merge-conflict
- id: check-added-large-files
args: ['--maxkb=500']
- id: mixed-line-ending
args: ['--fix=lf']

- repo: https://github.com/humitos/mirrors-autoflake.git
rev: v1.1
hooks:
- id: autoflake
args: ['--in-place', '--remove-all-unused-imports']

- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.9.3
hooks:
- id: isort
args: ['--multi-line=3', '--trailing-comma', '--force-grid-wrap=0', '--use-parentheses', '--line-width=88']

- repo: https://github.com/ambv/black
rev: 21.8b0
hooks:
- id: black
language_version: python3.8
args: ['--line-length=88']

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.1.10
hooks:
- id: remove-tabs
name: Tabs-to-Spaces
args: [--whitespaces-count, '4']
types: [sql]
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
---


## Summary
## Summary

pg_graphql is an experimental PostgreSQL extension adding support for GraphQL.

Expand Down Expand Up @@ -44,14 +44,14 @@ Set up an interactive psql prompt with the extension installed using docker
# Build image
docker build -t pg_graphql -f Dockerfile .

# Run container
# Run container
docker run --rm --name pg_gql -p 5085:5432 -d -e POSTGRES_DB=gqldb -e POSTGRES_PASSWORD=password -e POSTGRES_USER=postgres -d pg_graphql

# Attach to container
docker exec -it pg_gql psql -U postgres gqldb
```

Now we'll create the extension, and create a test table with some data to query
Now we'll create the extension, and create a test table with some data to query

```sql
gqldb= create extension pg_graphql;
Expand All @@ -60,7 +60,7 @@ CREATE EXTENSION
gqldb= create table book(id int primary key, title text);
CREATE TABLE

gqldb= insert into book(id, title) values (1, 'book 1');
gqldb= insert into book(id, title) values (1, 'book 1');
INSERT 0 1
```

Expand All @@ -74,7 +74,7 @@ query {
}
}
$$);
execute
execute
----------------------------------
{"data": {"book": {"book_id": 1, "title": "book 1"}}}
```
Expand Down Expand Up @@ -119,7 +119,7 @@ $$);
Requires:

- Python 3.6+
- Docker
- Docker

```shell
pip intall -e .
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def check_python_version():
setuptools.setup(
name="pg_graphql",
version="0.0.1",
#packages=setuptools.find_packages("src/python", exclude=("tests",)),
#package_dir={"": "src/python"},
# packages=setuptools.find_packages("src/python", exclude=("tests",)),
# package_dir={"": "src/python"},
classifiers=[
"Development Status :: 4 - Beta",
"Natural Language :: English",
Expand Down
Loading

0 comments on commit 3ab79c8

Please sign in to comment.