Skip to content

Commit

Permalink
update docs and code to match new rule (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
kiraware authored Sep 18, 2024
1 parent 55abdb3 commit 0484026
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
contents: read
id-token: write
runs-on: ubuntu-latest
environment: production
environment: release
steps:
- name: Checkout source code
uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-toml
- id: check-yaml
args: [--allow-multiple-documents]
- id: end-of-file-fixer
Expand Down
10 changes: 6 additions & 4 deletions docs/how-to-guides.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pre-commit install

We use [Poetry](https://python-poetry.org/) as the project
packaging and dependency management. Install development
dependency with the following command
dependency with the following command:

```console
poetry install
Expand All @@ -83,6 +83,7 @@ And done! You can make your changes and test thoroughly.
Then push your branch to your fork and submit a pull request.

!!! tip

If you have installed [poethepoet](https://poethepoet.natn.io/index.html)
globally, then you can use the command below only with
`poe lint`, `poe format`, etc instead of `poetry run poe lint`,
Expand Down Expand Up @@ -132,7 +133,7 @@ poetry run poe format-check
### Testing

We use [pytest](https://docs.pytest.org/en/stable/) for testing.
To run pytest you can use the following command
To run pytest you can use the following command:

```console
poetry run poe test
Expand Down Expand Up @@ -178,9 +179,10 @@ poetry run poe docs-build

We use the GitHub workflow to automatically release to PyPI when we
release to GitHub. The special environment for people who have access
to the workflow is in the GitHub environment with the name `production`.
to the workflow is in the GitHub environment with the name `release`.
Each release tag must be the same as `version` in `pyproject.toml` in
the `tool.poetry` section.
the `tool.poetry` section with prefix `v`, for example `v1.0.0`. Also
we follow Semantic Versioning with version number MAJOR.MINOR.PATCH.

### Update Dependency

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ target-version = "py311"
src = ["src", "tests"]

[tool.ruff.lint]
select = ["E", "F", "W", "I"]
ignore = []
select = ["F", "E", "W", "C90", "I", "B"]
ignore = ["E501", "C901"]

[tool.ruff.format]
docstring-code-format = true
Expand Down
1 change: 1 addition & 0 deletions src/bmkg/parsers/parse_weather_forecast_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def parse_weather_forecast_data(weather_forecast_data: str | bytes) -> WeatherFo
),
parameters["wd"],
parameters["ws"],
strict=False,
)
)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_parsers/test_parse_datetime_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ def test_parse_element_with_invalid_attribute():
with pytest.raises(
WeatherForecastParseError, match="datetime attribute in timerange tag not found"
):
for dt in parse_datetime_element(element):
for _dt in parse_datetime_element(element):
pass
4 changes: 2 additions & 2 deletions tests/test_parsers/test_parse_humidity_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_parse_element_with_invalid_attribute():
with pytest.raises(
WeatherForecastParseError, match="value tag in timerange tag not found"
):
for humidity in parse_humidity_element(element):
for _humidity in parse_humidity_element(element):
pass


Expand All @@ -31,5 +31,5 @@ def test_parse_element_with_invalid_humidity_text():
with pytest.raises(
WeatherForecastParseError, match="value tag in timerange tag has no text"
):
for humidity in parse_humidity_element(element):
for _humidity in parse_humidity_element(element):
pass
4 changes: 2 additions & 2 deletions tests/test_parsers/test_parse_temperature_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_parse_element_with_invalid_attribute():
WeatherForecastParseError,
match="one or more value tag in timerange tag not found",
):
for temperature in parse_temperature_element(element):
for _temperature in parse_temperature_element(element):
pass


Expand Down Expand Up @@ -49,5 +49,5 @@ def test_parse_element_with_invalid_value_elements_text(index, err_msg):
WeatherForecastParseError,
match=err_msg,
):
for temperature in parse_temperature_element(element):
for _temperature in parse_temperature_element(element):
pass
4 changes: 2 additions & 2 deletions tests/test_parsers/test_parse_weather_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_parse_element_with_invalid_attribute():
with pytest.raises(
WeatherForecastParseError, match="value tag in timerange tag not found"
):
for weather in parse_weather_element(element):
for _weather in parse_weather_element(element):
pass


Expand All @@ -31,5 +31,5 @@ def test_parse_element_with_invalid_weather_text():
with pytest.raises(
WeatherForecastParseError, match="value tag in timerange tag has no text"
):
for weather in parse_weather_element(element):
for _weather in parse_weather_element(element):
pass
4 changes: 2 additions & 2 deletions tests/test_parsers/test_parse_wind_direction_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_parse_element_with_invalid_attribute():
WeatherForecastParseError,
match="one or more value tag in timerange tag not found",
):
for wind_direction in parse_wind_direction_element(element):
for _wind_direction in parse_wind_direction_element(element):
pass


Expand Down Expand Up @@ -50,5 +50,5 @@ def test_parse_element_with_invalid_value_elements_text(index, err_msg):
WeatherForecastParseError,
match=err_msg,
):
for wind_direction in parse_wind_direction_element(element):
for _wind_direction in parse_wind_direction_element(element):
pass
4 changes: 2 additions & 2 deletions tests/test_parsers/test_parse_wind_speed_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def test_parse_element_with_invalid_attribute():
WeatherForecastParseError,
match="one or more value tag in timerange tag not found",
):
for wind_speed in parse_wind_speed_element(element):
for _wind_speed in parse_wind_speed_element(element):
pass


Expand Down Expand Up @@ -51,5 +51,5 @@ def test_parse_element_with_invalid_value_elements_text(index, err_msg):
WeatherForecastParseError,
match=err_msg,
):
for wind_speed in parse_wind_speed_element(element):
for _wind_speed in parse_wind_speed_element(element):
pass

0 comments on commit 0484026

Please sign in to comment.