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

Reimplementing the plugin #154

Merged
merged 17 commits into from
Jul 21, 2020
Merged

Conversation

yukihirop
Copy link
Owner

@yukihirop yukihirop commented Jul 21, 2020

Summary

Until now, the plugin was applied to the document generated from the routing.
However, I realized that it was not practical, so I changed it to apply it to the document generated from the src file.

  • Rename from routes:oas:dist to routes:oas:build.
  • The plugin will be applied when routes:oas:build is executed.
    • You can apply the plugin to the src file by setting OVERRIDE_SRC=true.
    • Build results are generated in ./oas_docs/dist/oas_doc.yml by default.
  • Modification of argument ref passed to plug-in block.
  • Remove routes:oas:plugin
  • Implement routes:oas:init
  • Divided the schema object classes into from_routes and from_files.
  • Update rubocop to 0.88

🚨 Be sure to ensure idempotency when creating a plugin.

Work

routes:oas:init

$ bundle exec routes:oas:init
$ tree -a oas_docs
oas_docs
├── .paths
├── plugins
│   ├── .gitkeep
│   └── helpers
│       └── .gitkeep
└── tasks
    └── .gitkeep
    └── helpers
        └── .gitkeep

3 directories, 4 files

Test

$ ./devscript/all_support_ruby rspec

===== Rspec for All Support Ruby Result =====
ruby-2.3.3: 0
ruby-2.4.2: 0
ruby-2.5.8: 0
ruby-2.6.6: 0
ruby-2.7.1: 0
=============================================

Rubocop

$ bundle exec rubocop
Inspecting 203 files
...........................................................................................................................................................................................................

203 files inspected, no offenses detected

yukihirop added 16 commits July 16, 2020 00:06
git grep -l '/schema/v3/object/' | xargs sed -i '' -e "s|/schema/v3/object/|/schema/v3/object/from_routes/|g"
It was hard to understand the implementation, and there were some bugs, so it was greatly improved.
It corresponded also to the following warning

```
The following cops were added to RuboCop, but are not configured. Please set Enabled to either `true` or `false` in your `.rubocop.yml` file:
 - Style/AccessorGrouping (0.87)
 - Style/BisectedAttrAccessor (0.87)
 - Style/RedundantAssignment (0.87)
 - Style/RedundantFetchBlock (0.86)
For more information: https://docs.rubocop.org/rubocop/versioning.html
```
@yukihirop yukihirop added this to the v0.4.0 milestone Jul 21, 2020
@yukihirop yukihirop self-assigned this Jul 21, 2020
@yukihirop
Copy link
Owner Author

LGTM

@yukihirop yukihirop merged commit 2c68aef into master Jul 21, 2020
@yukihirop yukihirop deleted the idempotency_when_applying_plugins branch July 21, 2020 05:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Consideration] Guarantee of idempotency when applying transform plugins (after v0.4.0)
1 participant