Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: format object properties with types #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
vankop wants to merge 7 commits into webpack:main
base: main
Choose a base branch
Loading
from vankop:more-info-for-object-properties

Conversation

Copy link
Member

@vankop vankop commented Sep 28, 2019

This PR contains a:

  • bugfix
  • new feature
  • code refactor
  • test update
  • typo fix
  • metadata update

Motivation / Use-Case

#42
2nd proposal

Breaking Changes

no

Additional Info

Looks like for array and object we can skip formatting type.

Copy link

codecov bot commented Sep 28, 2019
edited
Loading

Codecov Report

Merging #59 (db7e4f6) into master (62fb107) will decrease coverage by 0.58%.
The diff coverage is 97.67%.

Impacted file tree graph

@@ Coverage Diff @@
## master #59 +/- ##
==========================================
- Coverage 98.72% 98.13% -0.59% 
==========================================
 Files 5 5 
 Lines 550 645 +95 
 Branches 250 268 +18 
==========================================
+ Hits 543 633 +90 
- Misses 7 12 +5 
Impacted Files Coverage Δ
src/ValidationError.js 97.68% <97.33%> (-0.67%) ⬇️
src/index.js 100.00% <100.00%> (ø)
src/keywords/absolutePath.js 100.00% <100.00%> (ø)
src/util/Range.js 100.00% <100.00%> (ø)
src/validate.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 62fb107...db7e4f6. Read the comment docs.

Copy link
Member

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add test for multiple types, output should be like <key>: string | integer.

For objects we don't expand them, right?

Copy link
Member Author

vankop commented Sep 28, 2019

Yes objects and arrays are not expanded

Copy link
Member Author

vankop commented Sep 28, 2019

Multiple types could be only with anyOf | oneOf. Here we just look on type if it exists

Copy link
Member Author

vankop commented Sep 28, 2019

so @evilebottnawi what we need in this PR still? Tests on additionalProperties ?

Copy link
Member

alexander-akait commented Sep 28, 2019
edited
Loading

@vankop all is good, i will review deeply this in near future

Copy link
Member

/cc @vankop need rebase, also i think we should improve output using \n (like prettier do with objects 😄 ), because some error is very long

Copy link
Member Author

vankop commented Nov 11, 2019

also i think we should improve output using \n

@evilebottnawi you have any ideas how to do it better?

When I did this I was thinking about it, but did not realized how to do it better, since it depends totally on terminal window size + font type/size. Approach when we rely only on amount of properties also fails because of glyph sizes

Copy link
Member

alexander-akait commented Nov 12, 2019
edited
Loading

@vankop the good question, maybe we can solve this in other PR, i think packages like table have algorithm for this, need look on them logic

Copy link
Member Author

vankop commented Nov 26, 2019
edited
Loading

/cc @evilebottnawi

Ready to review

maybe we can solve this in other PR, i think packages like table have algorithm for this, need look on them logic

I think this really important, I will take a look in table package, thanks for suggestion

Copy link
Member Author

vankop commented Nov 26, 2019

Also interesting question is - do we need sort properties alphabetically?

Copy link
Member

@vankop it is very old 😄 what we will do with it? close or rebase? 😄

Copy link
Member Author

vankop commented Apr 15, 2023

I could merge main to make this relevant again

alexander-akait reacted with thumbs up emoji

Copy link
Member

@vankop Yeah, let's do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@alexander-akait alexander-akait alexander-akait left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /