Skip to content

Commit aa81fda

Browse files
committed
Exclude example from ruff linting and add extra check in init.py
1 parent 8bffc7f commit aa81fda

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.github/workflows/validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ jobs:
4747
- name: Lint with Ruff
4848
run: |
4949
pip install ruff
50-
ruff check --output-format=github --exclude=src/onepassword/lib/ .
50+
ruff check --output-format=github --exclude=src/onepassword/lib/,example/ .
5151
continue-on-error: true

example/example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ async def main():
1515
)
1616

1717
# Retrieves a secret from 1Password. Takes a secret reference as input and returns the secret to which it points.
18-
# value = await client.secrets.resolve("op://vault/item/field")
19-
# print(value)
18+
value = await client.secrets.resolve("op://vault/item/field")
19+
print(value)
2020

2121
# Create an Item and add it to your vault.
2222
to_create = Item(

src/onepassword/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@
1616
]
1717

1818
for name, obj in inspect.getmembers(sys.modules["onepassword.types"]):
19-
if inspect.isclass(obj) or type(eval(name)) == typing._LiteralGenericAlias:
19+
# Add all classes and instances of typing.Literal defined in types.py.
20+
if (inspect.isclass(obj) and inspect.getmodule(obj) == sys.modules["onepassword.types"]) or type(eval(name)) == typing._LiteralGenericAlias:
2021
__all__.append(name)

0 commit comments

Comments
 (0)