Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre commits #3

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,7 @@ cython_debug/
#.idea/

# Visual Studio
.vscode/
.vscode/

# ruff cache
.ruff_cache/
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.275
hooks:
- id: ruff
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
args:
- --check
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ Please make a pull request or log an issue on GitHub.

## License

Code is released as free software under the MIT License (see `LICENSE` file).
Code is released as free software under the MIT License (see `LICENSE` file).
4 changes: 2 additions & 2 deletions efaciency/block.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
"""efaciency block"""

from datetime import date, datetime, timedelta
from typing import List, Dict, Any
from typing import Any, Dict, List

from efaciency.utils import (
convert_to_local,
get_efa_block,
get_efa_date,
get_efa_start_time,
get_efa_end_time,
get_efa_start_time,
)


Expand Down
2 changes: 1 addition & 1 deletion efaciency/settlement_period.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""efaciency settlement_period"""

from datetime import date, datetime, timedelta
from typing import List, Dict, Any
from typing import Any, Dict, List

from efaciency.utils import (
convert_to_local,
Expand Down
16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,19 @@ dependencies = [

[project.urls]
"Homepage" = "https://github.com/capcir/efaciency"

[tool.ruff]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"C", # flake8-comprehensions
"B", # flake8-bugbear
]
ignore = [
"E501", # line too long, handled by black
]

[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]
3 changes: 2 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ black
coverage
flit
pytest
pytz
pytz
ruff
13 changes: 12 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,18 @@

import pytest

from efaciency.utils import *
from efaciency.utils import (
UTC,
convert_to_local,
convert_to_utc,
get_efa_block,
get_efa_date,
get_efa_end_time,
get_efa_start_time,
get_settlement_date,
get_settlement_period,
get_ts,
)

STR_FORMAT = "%Y-%m-%d %H:%M:%S%z"

Expand Down