Skip to content

Commit

Permalink
update pre-commit hooks and apply linting checks (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
d33bs authored Nov 4, 2024
1 parent 4161fe5 commit fdca950
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 27 deletions.
24 changes: 12 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ default_language_version:
python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -16,40 +16,40 @@ repos:
hooks:
- id: poetry-check
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "2.2.4"
rev: "v2.5.0"
hooks:
- id: pyproject-fmt
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
exclude: >
(?x)^(
.*\.lock|.*\.csv
.*\.lock|.*\.csv|.*\.cff
)$
additional_dependencies:
- tomli
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
rev: 0.7.18
hooks:
- id: mdformat
additional_dependencies:
- mdformat-myst
- mdformat-gfm
- repo: https://github.com/adrienverge/yamllint
rev: v1.33.0
rev: v1.35.1
hooks:
- id: yamllint
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
rev: 1.19.1
hooks:
- id: blacken-docs
- repo: https://github.com/PyCQA/bandit
rev: 1.7.6
rev: 1.7.10
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
Expand All @@ -59,19 +59,19 @@ repos:
hooks:
- id: isort
- repo: https://github.com/jendrikseipp/vulture
rev: v2.10
rev: v2.13
hooks:
- id: vulture
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.13.0
hooks:
- id: mypy
- repo: https://github.com/citation-file-format/cffconvert
rev: 5295f87c0e261da61a7b919fc754e3a77edd98a7
hooks:
- id: validate-cff
- repo: https://github.com/PyCQA/pylint
rev: v3.0.3
rev: v3.3.1
hooks:
- id: pylint
name: pylint
Expand Down
19 changes: 11 additions & 8 deletions cytotable/sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,17 @@ def _get_source_filepaths(
for unique_source in set(source["source_path"].name for source in sources):
grouped_sources[unique_source.capitalize()] = [
# case for files besides sqlite
source if source["source_path"].suffix.lower() != ".sqlite"
# if we have sqlite entries, update the source_path to the parent
# (the parent table database file) as grouped key name will now
# encapsulate the table name details.
else {
"source_path": source["source_path"].parent,
"table_name": source["table_name"],
}
(
source
if source["source_path"].suffix.lower() != ".sqlite"
# if we have sqlite entries, update the source_path to the parent
# (the parent table database file) as grouped key name will now
# encapsulate the table name details.
else {
"source_path": source["source_path"].parent,
"table_name": source["table_name"],
}
)
for source in sources
# focus only on entries which include the unique_source name
if source["source_path"].name == unique_source
Expand Down
2 changes: 1 addition & 1 deletion docs/source/code_of_conduct.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socioeconomic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

Expand Down
14 changes: 8 additions & 6 deletions tests/data/in-carta/colas-lab/shrink_colas_lab_data_for_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# as a pyarrow table then output to a new and
# smaller csv for testing purposes.

output_filename = (
OUTPUT_FILENAME = (
f"Test 0 Day{idx} Test Test_2024_Jan-0{idx+1}-{idx+12}-12-12_Test.csv"
)

Expand All @@ -67,9 +67,11 @@
"""
).arrow(),
# output the filtered data as a CSV to a new location
output_file=f"{TARGET_DATA_DIR}/{output_filename}"
# For some files lowercase the first letter of the file
# as a simulation of the source data.
if idx < 3
else f"{TARGET_DATA_DIR}/{output_filename[0].lower() + output_filename[1:]}",
output_file=(
f"{TARGET_DATA_DIR}/{OUTPUT_FILENAME}"
# For some files lowercase the first letter of the file
# as a simulation of the source data.
if idx < 3
else f"{TARGET_DATA_DIR}/{OUTPUT_FILENAME[0].lower() + OUTPUT_FILENAME[1:]}"
),
)

0 comments on commit fdca950

Please sign in to comment.