Skip to content

Commit

Permalink
Merge pull request #5 from greglucas/pre-commit-hooks
Browse files Browse the repository at this point in the history
MNT: Adding more pre-commit hooks
  • Loading branch information
greglucas authored Jun 26, 2023
2 parents bf5626c + 53f99fc commit 5138436
Show file tree
Hide file tree
Showing 7 changed files with 241 additions and 57 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Install dependencies and app
run: |
poetry install --extras "test"
- name: Testing
id: test
run: |
Expand Down
11 changes: 10 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
ci:
autofix_prs: false
autoupdate_schedule: 'quarterly'
skip: [poetry-lock, poetry-export]
skip: [poetry-lock]
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-added-large-files
- id: detect-aws-credentials
args: [--allow-missing-credentials]
- id: detect-private-key
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
Expand Down
6 changes: 3 additions & 3 deletions imap_processing/packet_definitions/swe_packet_definition.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
In this case, the uint1 data type is an unsigned integer with a size of 1 bit.
For fields that have meanings based on the values they evaluate to, enumerated data types need to be created.
Here's an example:
<xtce:EnumeratedParameterType name="cem_nominal_enum" signed="false">
<xtce:UnitSet/>
Expand All @@ -26,7 +26,7 @@
</xtce:EnumerationList>
</xtce:EnumeratedParameterType>
In this case, the cem_nominal_enum data type is an enumerated type with a size of 1 bit. It has two possible values:
In this case, the cem_nominal_enum data type is an enumerated type with a size of 1 bit. It has two possible values:
"NOT_NOMINAL" with a value of 0 and "NOMINAL" with a value of 1.
By defining the appropriate data types within the ParameterTypeSet, you ensure that the data fields in the packet definitions
Expand Down Expand Up @@ -148,7 +148,7 @@
</xtce:Parameter>
<xtce:Parameter name="CEM_NOMINAL_ONLY" parameterTypeRef="cem_nominal_enum">
<xtce:LongDescription>
CEM Nominal status bit:
CEM Nominal status bit:
'1' -- nominal,
'0' -- not nomimal
</xtce:LongDescription>
Expand Down
1 change: 0 additions & 1 deletion imap_processing/swe/decom_swe.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

from imap_processing import decom


Expand Down
8 changes: 4 additions & 4 deletions imap_processing/swe/tests/test_decom.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import pytest

from imap_processing.swe import decom_swe
Expand All @@ -22,7 +21,8 @@ def test_ccsds_header(decom_test_data):
"""Test if packet header contains default CCSDS header
These are the field required in CCSDS header:
'VERSION', 'TYPE', 'SEC_HDR_FLG', 'PKT_APID', 'SEG_FLGS', 'SRC_SEQ_CTR', 'PKT_LEN'
'VERSION', 'TYPE', 'SEC_HDR_FLG', 'PKT_APID',
'SEG_FLGS', 'SRC_SEQ_CTR', 'PKT_LEN'
"""
# Required CCSDS header fields
ccsds_header_keys = [
Expand All @@ -36,8 +36,8 @@ def test_ccsds_header(decom_test_data):
]

# decom_test_data[0].header is one way to get the header data. Another way to get it
# is using list method. Eg. ccsds_header = decom_test_data[0][0]. Each packet's 0th index
# has header data and index 1 has data.
# is using list method. Eg. ccsds_header = decom_test_data[0][0].
# Each packet's 0th index has header data and index 1 has data.

# First way to get header data
ccsds_header = decom_test_data[0].header
Expand Down
268 changes: 222 additions & 46 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ target-version = "py39"
select = ["B", "E", "F", "I", "N", "S", "W", "PL", "PT", "UP", "RUF"]
# Ignore import sorting for now until lines_after_imports is respected
# by ruff and we can replace isort
ignore = ["D203", "D212", "PLR0913", "PLR2004"]
ignore = ["D203", "D212", "PLR0913", "PLR2004", "S101"]

0 comments on commit 5138436

Please sign in to comment.