luttik / auto-optional Goto Github PK
View Code? Open in Web Editor NEWMakes typed arguments Optional when the default argument is None
Home Page: https://auto-optional.daanluttik.nl/
License: MIT License
Makes typed arguments Optional when the default argument is None
Home Page: https://auto-optional.daanluttik.nl/
License: MIT License
Add a diff
, dry-run
or check
command for linting.
Preferably:
--check
Leave a ๐ if you want this.
Add an exclude option
Consider:
Leave a ๐ if you want this
Hi @Luttik ,
I am trying to use it in an existing project and I am adding next config to my .pre-commit-config.yaml
file.
The idea that I want to specify path to command so it checks src/
folder only
Here is an overview structure of project:
...
โโโ requirements-dev.in
โโโ requirements-dev.txt
โโโ requirements.in
โโโ requirements.txt
โโโ src
โโโ static
โโโ templates
โโโ tmp
...
This is config for auto-optional
which I integrate into .pre-commit-config.yaml
file
......
- id: auto-optional
name: auto-optional
description: Adds the Optional type-hint to arguments where the default value is None
entry: auto-optional src/
language: python
types: [python]
....
And I am getting next errors:
Error: Got unexpected extra arguments (src/asgi.py src/accounts/models/bill_blacklist_models.py src/hooks/models.py .... (continue list of files which should be proceeded)
Added pass_filenames: false
so in the end the config should be:
- id: auto-optional
name: auto-optional
description: Adds the Optional type-hint to arguments where the default value is None
entry: auto-optional src/
language: python
types: [python]
pass_filenames: false
It takes longer time on the whole for verifying but this is a temp solution for that.
Union[None, str] should not become Optional[Union[None, str]]
This does not make sense.
auto-optional==0.1.11
python 3.9.7
Add an in-line ignore option.
Support:
# noqa
# auto-optional: ignore
Leave a ๐ if you want this
Support other file-formats than UTF-8 for python code
Leave a ๐ if you want this
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.