Skip to content
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

feat: flag definitions that are defined but never used #144

Merged
merged 1 commit into from
Feb 21, 2020

Conversation

barrett-schonefeld
Copy link
Contributor

@barrett-schonefeld barrett-schonefeld commented Feb 19, 2020

Changes:

  • added checks for parameters, responses, and other definitions in the components section that are not used in the API definition
  • updated comments in refs.js
  • restructured refs.js as needed to support checking components.parameters and components.responses

Tests:

  • added tests to that ensure that a warning is issued when a response or parameter definition is not used
  • added tests to ensure a warning is not issued when a response or parameter definition is used

@codecov
Copy link

codecov bot commented Feb 19, 2020

Codecov Report

Merging #144 into master will increase coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #144      +/-   ##
==========================================
+ Coverage   92.86%   92.88%   +0.02%     
==========================================
  Files          61       61              
  Lines        2103     2109       +6     
==========================================
+ Hits         1953     1959       +6     
  Misses        150      150              

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 628d6c0...a68dbae. Read the comment docs.

Copy link
Member

@dpopp07 dpopp07 left a comment

Choose a reason for hiding this comment

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

Looks good - your approach is simple enough that we can take advantage and validate refs for all fields under components, so we might as well

- added checks for parameters, responses, and all other components object types defined in the components section that are not used in the API definition
- added tests to that ensure that a warning is issued when a response or parameter definition is not used
- added tests to ensure a warning is not issued when a response or parameter definition is used
- updated comments in refs.js
- restructured refs.js as needed to support checking components.parameters and components.responses
@barrett-schonefeld barrett-schonefeld changed the title feat: flag parameters and responses that are defined but never used feat: flag definitions that are defined but never used Feb 20, 2020
Copy link
Contributor

@mkistler mkistler left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

Copy link
Member

@dpopp07 dpopp07 left a comment

Choose a reason for hiding this comment

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

Looks good! 👍

@dpopp07 dpopp07 merged commit a131408 into master Feb 21, 2020
@dpopp07 dpopp07 deleted the defined-but-never-used branch February 21, 2020 18:35
dpopp07 pushed a commit that referenced this pull request Feb 21, 2020
# [0.22.0](v0.21.0...v0.22.0) (2020-02-21)

### Features

* flag definitions that are defined but never used ([#144](#144)) ([a131408](a131408))
@dpopp07
Copy link
Member

dpopp07 commented Feb 21, 2020

🎉 This PR is included in version 0.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

None yet

3 participants