Skip to content

Commit

Permalink
add pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Clivern committed Jan 18, 2022
1 parent 006d80c commit 8751f76
Show file tree
Hide file tree
Showing 44 changed files with 59 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Docs: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
* @clivern
* @clivern
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github: clivern
github: clivern
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ Project maintainers who do not follow or enforce the Code of Conduct in good fai
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[version]: http://contributor-covenant.org/version/1/4/
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
- Your pull request should have no more than two commits, if not you should squash them.
- It should pass all tests in the available continuous integrations systems such as Github Actions.
- You should add/modify tests to cover your proposed code changes.
- If your pull request contains a new feature, please document it on the README.
- If your pull request contains a new feature, please document it on the README.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -187,4 +187,4 @@
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ FLAKE8 ?= flake8
NPM ?= npm
NPX ?= npx
GUNICORN ?= gunicorn
PRECOMMIT ?= pre-commit


help: Makefile
Expand Down Expand Up @@ -159,10 +160,17 @@ package:
$(PYTHON) manage.py build_ui


## precommit: Run pre-commit hooks
.PHONY: precommit
precommit:
$(PRECOMMIT) install
$(PRECOMMIT) run --all-files


## ci: Run all CI tests.
.PHONY: ci
ci: coverage lint outdated-pkg
ci: coverage lint precommit outdated-pkg
@echo "\n>> ============= All quality checks passed ============= <<"


.PHONY: help
.PHONY: help
2 changes: 1 addition & 1 deletion api_definition.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ info:
license:
name: Apache License 2.0
url: https://github.com/Clivern/Cattle/blob/main/LICENSE
version: 1.0.0
version: 1.0.1
externalDocs:
description: Find out more about cattle
url: https://github.com/Clivern/Cattle
Expand Down
2 changes: 1 addition & 1 deletion deployment/ubuntu/configure/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.terraform
hosts.prod
venv
venv
2 changes: 1 addition & 1 deletion deployment/ubuntu/configure/roles/common/templates/motd.j2
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
Server is Managed by Cattle Ansible Playbook

* Link: https://github.com/Clivern/Cattle
* Version: v1.0.0
* Version: v1.0.1
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ python manage.py wait_for_db

# Migrate Database
python manage.py migrate
exec "$@"
exec "$@"
2 changes: 1 addition & 1 deletion flake8.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[flake8]
statistics=True
format=Code:%(code)s File:%(path)s Line:%(row)d Column:%(col)d Info:%(text)s
max-line-length=200
max-line-length=200
2 changes: 1 addition & 1 deletion newrelic_dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -487,4 +487,4 @@
]
}
]
}
}
2 changes: 1 addition & 1 deletion pycodestyle
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ count=True
ignore=
max-line-length=200
statistics=True
format = Code:%(code)s File:%(path)s Line:%(row)d Column:%(col)d Info:%(text)s
format = Code:%(code)s File:%(path)s Line:%(row)d Column:%(col)d Info:%(text)s
1 change: 1 addition & 0 deletions requirements.test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ flake8==3.9.2
flake8-comprehensions==3.5.0
flake8-eradicate==1.0.0
flake8-todo==0.7
pre-commit==2.16.0
2 changes: 1 addition & 1 deletion schemas/api/v1/code/create.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@
"language",
"version"
]
}
}
2 changes: 1 addition & 1 deletion schemas/api/v1/code/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@
"language",
"version"
]
}
}
2 changes: 1 addition & 1 deletion schemas/api/v1/code/update.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@
"language",
"version"
]
}
}
2 changes: 1 addition & 1 deletion static/css/chunk-57d77030.db363d35.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a[data-v-4474e8c3]{color:#42b983}.logo{margin:10px}.copyright,.logo{text-align:center}.copyright{margin:9px;font-family:monospace!important}
a[data-v-4474e8c3]{color:#42b983}.logo{margin:10px}.copyright,.logo{text-align:center}.copyright{margin:9px;font-family:monospace!important}
2 changes: 1 addition & 1 deletion static/css/chunk-59e19a73.ce99e5eb.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a[data-v-6616d79a]{color:#42b983}.logo{margin:10px}.copyright,.logo{text-align:center}.copyright{margin:9px;font-family:monospace!important}
a[data-v-6616d79a]{color:#42b983}.logo{margin:10px}.copyright,.logo{text-align:center}.copyright{margin:9px;font-family:monospace!important}
2 changes: 1 addition & 1 deletion static/css/chunk-60d7c062.0791cd1a.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/css/chunk-7d259924.cd2c08ea.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a[data-v-535e062f]{color:#42b983}.logo{text-align:center;margin:10px}.CodeMirror{font-size:14px}.editor-footer{margin:12px}.copyright{text-align:center;margin:9px;font-family:monospace!important}.editor{padding:40px}
a[data-v-535e062f]{color:#42b983}.logo{text-align:center;margin:10px}.CodeMirror{font-size:14px}.editor-footer{margin:12px}.copyright{text-align:center;margin:9px;font-family:monospace!important}.editor{padding:40px}
2 changes: 1 addition & 1 deletion static/css/chunk-93e44130.ca794933.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a[data-v-bdcee3b0]{color:#42b983}.logo{text-align:center;margin:10px}.CodeMirror{font-size:14px}.editor-footer{margin:12px}.copyright{text-align:center;margin:9px;font-family:monospace!important}.editor{padding:40px}
a[data-v-bdcee3b0]{color:#42b983}.logo{text-align:center;margin:10px}.CodeMirror{font-size:14px}.editor-footer{margin:12px}.copyright{text-align:center;margin:9px;font-family:monospace!important}.editor{padding:40px}
2 changes: 1 addition & 1 deletion static/css/chunk-vendors.e4c7b908.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/static/logo.png"><title>Cattle - Run and Share Code</title><link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.2.0/css/all.css"><script async src="https://www.googletagmanager.com/gtag/js?id={{ google_id }}"></script><script>window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '{{ google_id }}');</script><link href="/static/css/chunk-57d77030.db363d35.css" rel="prefetch"><link href="/static/css/chunk-59e19a73.ce99e5eb.css" rel="prefetch"><link href="/static/css/chunk-60d7c062.0791cd1a.css" rel="prefetch"><link href="/static/css/chunk-7d259924.cd2c08ea.css" rel="prefetch"><link href="/static/css/chunk-93e44130.ca794933.css" rel="prefetch"><link href="/static/js/chunk-57d77030.8689b89e.js" rel="prefetch"><link href="/static/js/chunk-59e19a73.a82fadf9.js" rel="prefetch"><link href="/static/js/chunk-60d7c062.a01c4921.js" rel="prefetch"><link href="/static/js/chunk-7d259924.5c106372.js" rel="prefetch"><link href="/static/js/chunk-93e44130.a568d69f.js" rel="prefetch"><link href="/static/css/chunk-vendors.e4c7b908.css" rel="preload" as="style"><link href="/static/js/app.2fb48d64.js" rel="preload" as="script"><link href="/static/js/chunk-vendors.56e96662.js" rel="preload" as="script"><link href="/static/css/chunk-vendors.e4c7b908.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but Cattle doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/static/js/chunk-vendors.56e96662.js"></script><script src="/static/js/app.2fb48d64.js"></script></body></html>
gtag('config', '{{ google_id }}');</script><link href="/static/css/chunk-57d77030.db363d35.css" rel="prefetch"><link href="/static/css/chunk-59e19a73.ce99e5eb.css" rel="prefetch"><link href="/static/css/chunk-60d7c062.0791cd1a.css" rel="prefetch"><link href="/static/css/chunk-7d259924.cd2c08ea.css" rel="prefetch"><link href="/static/css/chunk-93e44130.ca794933.css" rel="prefetch"><link href="/static/js/chunk-57d77030.8689b89e.js" rel="prefetch"><link href="/static/js/chunk-59e19a73.a82fadf9.js" rel="prefetch"><link href="/static/js/chunk-60d7c062.a01c4921.js" rel="prefetch"><link href="/static/js/chunk-7d259924.5c106372.js" rel="prefetch"><link href="/static/js/chunk-93e44130.a568d69f.js" rel="prefetch"><link href="/static/css/chunk-vendors.e4c7b908.css" rel="preload" as="style"><link href="/static/js/app.2fb48d64.js" rel="preload" as="script"><link href="/static/js/chunk-vendors.56e96662.js" rel="preload" as="script"><link href="/static/css/chunk-vendors.e4c7b908.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but Cattle doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/static/js/chunk-vendors.56e96662.js"></script><script src="/static/js/app.2fb48d64.js"></script></body></html>
2 changes: 1 addition & 1 deletion static/js/app.2fb48d64.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion static/js/app.2fb48d64.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion static/js/chunk-57d77030.8689b89e.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8751f76

Please sign in to comment.