Skip to content

Commit

Permalink
Update .pre-commit-config.yaml (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
yu-iskw authored Jul 5, 2023
1 parent 13a3e2c commit 097ca92
Show file tree
Hide file tree
Showing 25 changed files with 65 additions and 42 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ dmypy.json
.pyre/

# VSCode
.vscode
.vscode
30 changes: 24 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,32 @@ repos:
- id: check-yaml
- id: detect-private-key
- repo: https://github.com/rhysd/actionlint
rev: v1.6.24
rev: v1.6.25
hooks:
- id: actionlint
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.9.0
hooks:
- id: reorder-python-imports
# - repo: https://github.com/asottile/reorder_python_imports
# rev: v3.10.0
# hooks:
# - id: reorder-python-imports
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.2.0
rev: v2.4.0
hooks:
- id: setup-cfg-fmt
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
- repo: https://github.com/pycqa/pylint
rev: v3.0.0a6
hooks:
- id: pylint
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: 'v1.4.1'
# hooks:
# - id: mypy
# additional_dependencies: [types-all]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.5
hooks:
- id: shellcheck
11 changes: 6 additions & 5 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ disable=abstract-method,
missing-module-docstring,
missing-class-docstring,
invalid-name,
unexpected-keyword-arg,


[REPORTS]
Expand Down Expand Up @@ -279,9 +280,9 @@ single-line-if-stmt=yes
# Maximum number of lines in a module
max-module-lines=99999

# String used as indentation unit. The internal Google style guide mandates 2
# String used as indentation unit. The internal Google style guide mandates 4
# spaces. Google's externaly-published style guide says 4, consistent with
# PEP 8. Here, we use 2 spaces, for conformity with many open-sourced Google
# PEP 8. Here, we use 4 spaces, for conformity with many open-sourced Google
# projects (like TensorFlow).
indent-string=' '

Expand Down Expand Up @@ -427,6 +428,6 @@ valid-metaclass-classmethod-first-arg=mcs

# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=StandardError,
Exception,
BaseException
overgeneral-exceptions=builtins.StandardError,
builtins.Exception,
builtins.BaseException
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ setup-pre-commit:

# Check all the coding style.
.PHONY: lint
lint: lint-shell lint-python
lint: run-pre-commit lint-shell lint-python

.PHONE: run-pre-commit
run-pre-commit:
pre-commit run --all-files

# Check the coding style for the shell scripts.
.PHONY: lint-shell
Expand Down
1 change: 1 addition & 0 deletions dbt_artifacts_parser/parsers/manifest/manifest_v5.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# pylint: disable=no-name-in-module
from pydantic import Extra, Field, constr

from dbt_artifacts_parser.parsers.base import BaseParserModel


Expand Down
1 change: 1 addition & 0 deletions dbt_artifacts_parser/parsers/manifest/manifest_v6.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# pylint: disable=no-name-in-module
from pydantic import Extra, Field, constr

from dbt_artifacts_parser.parsers.base import BaseParserModel


Expand Down
1 change: 1 addition & 0 deletions dbt_artifacts_parser/parsers/manifest/manifest_v7.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from typing import Any, Dict, List, Optional, Union

from pydantic import Extra, Field, constr

from dbt_artifacts_parser.parsers.base import BaseParserModel


Expand Down
3 changes: 2 additions & 1 deletion dbt_artifacts_parser/parsers/manifest/manifest_v8.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
from enum import Enum
from typing import Any, Dict, List, Optional, Union

from dbt_artifacts_parser.parsers.base import BaseParserModel
from pydantic import Extra, Field, constr

from dbt_artifacts_parser.parsers.base import BaseParserModel


class ManifestMetadata(BaseParserModel):
class Config:
Expand Down
12 changes: 3 additions & 9 deletions dbt_artifacts_parser/parsers/manifest/manifest_v9.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,9 @@

from datetime import datetime
from enum import Enum
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Union

from pydantic import constr
from pydantic import Extra
from pydantic import Field
from typing import Any, Dict, List, Optional, Union

from pydantic import Extra, Field, constr

from dbt_artifacts_parser.parsers.base import BaseParserModel

Expand Down
2 changes: 1 addition & 1 deletion dbt_artifacts_parser/resources/manifest/manifest_v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -5222,4 +5222,4 @@
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.getdbt.com/dbt/manifest/v3.json"
}
}
2 changes: 1 addition & 1 deletion dbt_artifacts_parser/resources/manifest/manifest_v4.json
Original file line number Diff line number Diff line change
Expand Up @@ -5936,4 +5936,4 @@
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.getdbt.com/dbt/manifest/v4.json"
}
}
2 changes: 1 addition & 1 deletion dbt_artifacts_parser/resources/manifest/manifest_v5.json
Original file line number Diff line number Diff line change
Expand Up @@ -5981,4 +5981,4 @@
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.getdbt.com/dbt/manifest/v5.json"
}
}
2 changes: 1 addition & 1 deletion dbt_artifacts_parser/resources/manifest/manifest_v6.json
Original file line number Diff line number Diff line change
Expand Up @@ -6206,4 +6206,4 @@
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.getdbt.com/dbt/manifest/v6.json"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -378,4 +378,4 @@
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.getdbt.com/dbt/run-results/v3.json"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -397,4 +397,4 @@
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.getdbt.com/dbt/run-results/v4.json"
}
}
2 changes: 1 addition & 1 deletion dbt_artifacts_parser/resources/sources/sources_v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,4 @@
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.getdbt.com/dbt/sources/v2.json"
}
}
2 changes: 1 addition & 1 deletion dbt_artifacts_parser/resources/sources/sources_v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,4 +277,4 @@
},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.getdbt.com/dbt/sources/v3.json"
}
}
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ classifiers = [
]
dynamic = ["version", "description"]
dependencies = [
"pydantic >=1.6",
"pydantic >=1.6,<2.0",
"datamodel-code-generator >=0.12.0",
]

Expand All @@ -55,3 +55,6 @@ dev = [
"pdoc3 >=0.9.2",
"pre-commit >=2.15.0",
]

[tool.isort]
profile = "black"
7 changes: 3 additions & 4 deletions tests/parsers/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@
# limitations under the License.
#
#
import os
import json
import os

import pytest

from dbt_artifacts_parser.utils import get_project_root
from dbt_artifacts_parser.parsers.utils import get_dbt_schema_version, get_model_class

from dbt_artifacts_parser.parsers.catalog.catalog_v1 import CatalogV1
from dbt_artifacts_parser.parsers.manifest.manifest_v1 import ManifestV1
from dbt_artifacts_parser.parsers.manifest.manifest_v2 import ManifestV2
Expand All @@ -39,7 +36,9 @@
from dbt_artifacts_parser.parsers.sources.sources_v1 import SourcesV1
from dbt_artifacts_parser.parsers.sources.sources_v2 import SourcesV2
from dbt_artifacts_parser.parsers.sources.sources_v3 import SourcesV3
from dbt_artifacts_parser.parsers.utils import get_dbt_schema_version, get_model_class
from dbt_artifacts_parser.parsers.version_map import ArtifactTypes
from dbt_artifacts_parser.utils import get_project_root


class TestDbtUtils:
Expand Down
Loading

0 comments on commit 097ca92

Please sign in to comment.