Skip to content

Commit

Permalink
build(deps): add pydoclint pre-commit hook (#310)
Browse files Browse the repository at this point in the history
update:
- isort: 5.13.2 → 6.0.0
  • Loading branch information
cesarcoatl authored Jan 28, 2025
1 parent 8f89311 commit 0f56191
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 23 deletions.
7 changes: 6 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
[flake8]
ignore = E741, F821
ignore = DOC202, E741, F821
max-complexity = 10
max-doc-length = 72
max-line-length = 120
# pydoclint
style = google
arg-type-hints-in-signature = False
arg-type-hints-in-docstring = False
check-return-types = False
15 changes: 9 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repos:
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
rev: 6.0.0
hooks:
- id: isort
- repo: https://github.com/coatl-dev/docformatter
Expand All @@ -25,15 +25,18 @@ repos:
hooks:
- id: pydocstyle
exclude: ^(src/ch/|src/com/|src/dev/|src/java/|src/javax/|src/org/)
- repo: https://github.com/jsh9/pydoclint
rev: 0.6.0
hooks:
- id: pydoclint-flake8
- repo: https://github.com/coatl-dev/hadolint-coatl
rev: 2.12.1b0
hooks:
- id: hadolint
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
files: ^src/
types: [python]
- repo: https://github.com/coatl-dev/hadolint-coatl
rev: 2.12.1b0
hooks:
- id: hadolint
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ API. For more information, see documentation here:

This package includes supporting classes and interfaces from the Inductive
Automation's `org.json` package, see documentation here:
<https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.44/org/json/package-summary.html>
<https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.45/org/json/package-summary.html>

#### org.python

Expand All @@ -132,7 +132,7 @@ information, see documentation here:

This package includes supporting classes and interfaces from SLF4J API Module.
For more information, see documentation here:
<https://www.javadoc.io/doc/org.slf4j/slf4j-api/1.7.26/overview-summary.html>.
<https://www.javadoc.io/doc/org.slf4j/slf4j-api/1.7.30/overview-summary.html>.

#### system

Expand Down
27 changes: 23 additions & 4 deletions src/com/inductiveautomation/ignition/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@
from com.inductiveautomation.ignition.common.gson import Gson, JsonElement
from dev.coatl.helper.types import AnyStr
from java.awt import Color
from java.lang import Class, Comparable, Number, Object
from java.lang import (
ArrayIndexOutOfBoundsException,
Class,
ClassCastException,
Comparable,
IllegalArgumentException,
Number,
Object,
UnsupportedOperationException,
)
from java.util import UUID, Comparator, Date, Locale
from org.json import JSONObject
from org.python.core import PyObject
Expand Down Expand Up @@ -51,7 +60,11 @@ def binarySearch(self, column, key):
UnsupportedOperationException: If the Dataset implementation
declines to implement this operation.
"""
pass
if column == 0 and key is None:
raise ClassCastException()
if column == -1 and key is None:
raise UnsupportedOperationException()
return 42

def getColumnAsList(self, col):
# type: (int) -> List[Any]
Expand Down Expand Up @@ -327,7 +340,11 @@ def getPrimitiveValueAt(self, row, col):
UnsupportedOperationException: If the Dataset implementation
declines to implement this operation.
"""
pass
if row == 0 and col == 0:
raise IllegalArgumentException()
if row == -1 and col == -1:
raise UnsupportedOperationException()
return 42.0

def getQualityAt(self, row, col):
# type: (int, int) -> Any
Expand All @@ -344,7 +361,9 @@ def getQualityAt(self, row, col):
ArrayIndexOutOfBoundsException: If the given row, col is out
of range and hasQualityData() returns true.
"""
pass
if row == -1 and col == -1:
raise ArrayIndexOutOfBoundsException()
return Object()

def getRowCount(self):
# type: () -> int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
from com.inductiveautomation.ignition.common.script.message import Request
from dev.coatl.helper.types import AnyStr
from java.io import OutputStream, Writer
from java.lang import Class
from java.lang import ArrayIndexOutOfBoundsException, Class
from java.lang import Exception as JavaException
from java.lang import Object
from java.lang import IllegalArgumentException, Object, UnsupportedOperationException
from java.util import Locale
from org.json import JSONObject
from org.python.core import PyFunction, PyList, PyObject, PySequence
Expand Down Expand Up @@ -286,7 +286,9 @@ def getColumnIndex(self, colName):
ArrayIndexOutOfBoundsException: If the column isn't
found.
"""
pass
if not colName:
raise ArrayIndexOutOfBoundsException()
return 0

def getColumnName(self, col):
# type: (int) -> AnyStr
Expand All @@ -302,7 +304,9 @@ def getColumnName(self, col):
ArrayIndexOutOfBoundsException: If the given index is
out of range.
"""
pass
if col == -1:
raise ArrayIndexOutOfBoundsException()
return "column_name"

def getColumnNames(self):
# type: () -> List[AnyStr]
Expand All @@ -327,7 +331,9 @@ def getColumnType(self, col):
ArrayIndexOutOfBoundsException: If the given index is
out of range.
"""
pass
if col == -1:
raise ArrayIndexOutOfBoundsException()
return Class()

def getColumnTypes(self):
# type: () -> List[Class]
Expand Down Expand Up @@ -358,7 +364,11 @@ def getPrimitiveValueAt(self, row, col):
UnsupportedOperationException: If the Dataset
implementation declines to implement this operation.
"""
pass
if row == 0 and col == 0:
raise IllegalArgumentException()
if row == -1 and col == -1:
raise UnsupportedOperationException()
return 42.0

def getQualityAt(self, row, col):
# type: (int, int) -> QualityCode
Expand All @@ -372,10 +382,12 @@ def getQualityAt(self, row, col):
The quality of the value at the given location.
Raises:
ArrayIndexOutOfBoundsException: If the given row, col is
out of range and hasQualityData() returns true.
ArrayIndexOutOfBoundsException: If the column isn't
found.
"""
pass
if row == -1 and col == -1:
raise ArrayIndexOutOfBoundsException()
return QualityCode().Good

def getRowCount(self):
# type: () -> int
Expand All @@ -402,6 +414,8 @@ def getValueAt(self, row, col):
ArrayIndexOutOfBoundsException: If the column isn't
found.
"""
if row == 0 and col == 0:
raise ArrayIndexOutOfBoundsException()
print(row, col)
return True

Expand Down
4 changes: 3 additions & 1 deletion src/system/mongodb/types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""MongoDB Types."""

from org.bson.types import Binary
from org.bson.types import (
Binary,
)
from org.bson.types import BSONTimestamp as Timestamp
from org.bson.types import (
Code,
Expand Down

0 comments on commit 0f56191

Please sign in to comment.