Skip to content

Commit

Permalink
Merge pull request #103 from datamol-io/feat/pre-commit
Browse files Browse the repository at this point in the history
Pre-commit hook for code linting
  • Loading branch information
zhu0619 authored Aug 12, 2024
2 parents 34b99f6 + 49c41d7 commit 0a17bb0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: Install black
run: |
pip install black>=23
pip install black>=24
- name: Lint
run: black --check .
Expand Down
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
repos:
- repo: https://github.com/psf/black
rev: "24.8.0" # run `pre-commit autoupdate`
hooks:
- id: black
name: black
entry: black
args:
- --check
language: system
types: [python]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.5.7"
hooks:
- id: ruff
name: ruff
entry: ruff
args: ["check"]
language: system
types: [python]
1 change: 1 addition & 0 deletions env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ dependencies:
- ruff
- jupyterlab
- nbconvert
- pre_commit

# Doc
- mkdocs
Expand Down
2 changes: 1 addition & 1 deletion molfeat/trans/fp.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def __str__(self):
return self.__repr__()

def __eq__(self, other):
same_type = type(self) == type(other)
same_type = isinstance(self, type(other))
return same_type and all(
[getattr(other, k) == v for k, v in self.get_params() if not callable(v)]
)
Expand Down

0 comments on commit 0a17bb0

Please sign in to comment.