Comments (7)
This is a good point. I personally got used to run all linters separately on my laptop but this needs to be automated. I’ll handle this.
I've recently started using taskfile (e.g. here is one of them - most of the cleanup is via pre-commit which is also called from GitHub action). Taskfile is pretty nice and easy to write tasks (I have much more complicated stuff in private repos), although one think I miss that just has - ability to pass arbitrary args without -- ...
. So both options seems great, especially compared with Makefile...
from mashumaro.
P.S. I'd say a just/taskfile/make with a command to run the preferred linting that would match CI test would be cool!
On your request https://github.com/Fatal1ty/mashumaro/blob/master/justfile
P.S. Sadly, it seems like zsh completions work only for the first recipe. When I type the first letter of the second recipe, I don't see any suggestions on ⇥ Tab.
from mashumaro.
I was surprised that this has not been asked before, it seems a very natural thing to me.
In my experience ignoring extra keys is a blessing in scenarios when you want to be forward compatible. Maybe, I’m not the only one in this boat, so this may explain why this feature hasn’t been requested yet :)
Actually, the first one who wanted to forbid extra keys was @mishamsk, and we are waiting for him to split his valuable pull request #183 (comment) that will probably resolve this issue.
Meanwhile, I have a list of tasks that need to be solved by the next release (and #42 is one of them). However, if this is a blocker for you, I might consider implementing it myself or taking the PR from @mishamsk as a basis if he doesn’t mind. At least we now have this feature request documented :)
from mashumaro.
hey all. I wrote a long comment why I won't be able to split that until April and then it got boring and I just split the code. Hopefully now you'll be ok to merge one or both of the PRs.
P.S. I'd say a just/taskfile/make with a command to run the preferred linting that would match CI test would be cool!
from mashumaro.
@mishamsk Welcome back! I will look into this as soon as possible, most likely this week.
P.S. I'd say a just/taskfile/make with a command to run the preferred linting that would match CI test would be cool!
This is a good point. I personally got used to run all linters separately on my laptop but this needs to be automated. I’ll handle this.
from mashumaro.
@mishamsk Nice to see a PR. :) I had missed your (now closed) PR because I only searched through issues...
In my experience ignoring extra keys is a blessing in scenarios when you want to be forward compatible.
This made me think. I assume one common thing that applications may want to do is ignore but not silently, i.e., issue a warning to the user or write into the log file.
In fact, that's true for other errors, too. One general approach is to ignore errors (e.g., skip invalid values and extra keys) but record them into a list of exceptions and finish parsing to the end. Then at the end, if they were errors, throw an exception and include the parsed object in the exception, and the list of other exceptions. This does the right thing in the sense that it raises a real error if the user asks for it, but the caller can still continue. But the approach is pretty heavy, possibly too much for this kind of library (and certainly not to be included in the current PR).
Sorry for throwing so many suggestions at you... ^^ These are really rather just my ideas, not things that I'd need.
from mashumaro.
P.S. I'd say a just/taskfile/make with a command to run the preferred linting that would match CI test would be cool!
On your request https://github.com/Fatal1ty/mashumaro/blob/master/justfile
P.S. Sadly, it seems like zsh completions work only for the first recipe. When I type the first letter of the second recipe, I don't see any suggestions on ⇥ Tab.
awesome. completions or not!
from mashumaro.
Related Issues (20)
- omit_default=True evaluates default_factory value at declaration time which can cause a circular reference HOT 3
- Multiple aliases for field HOT 6
- "`dict[str, T]` as a field type is not supported" HOT 2
- InitVar with no default value HOT 6
- The types defined inside the function result in syntactically invalid generated code
- Allow for more complex logic for subclass Discrimnator field matching HOT 3
- TypedDicts not working with `from __future__ import annotations` HOT 2
- omit_default breaks IntFlag serialization HOT 1
- Using Union with int/float casts to whichever appears first HOT 3
- Not parsing Generics correctly HOT 2
- Unserializable field in 3.12 if defined as a Generic TypeVar with mixin bounds HOT 6
- Allow propagation of class based discriminator settings to subclasses HOT 3
- Investigate support for recursive Union types HOT 2
- Supports `numpy.ndarray` type for `orjson` HOT 2
- Add support for PEP 695
- Union type of [int | float] not serialized correctly HOT 2
- Add an alternative way to assign a field alias with annotations
- Add support for PEP 696
- Annotated SerializationStrategy used as a field serialization strategy leads to RecursionError
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mashumaro.