Skip to content

fix: Allow both 'yml' and 'yaml' extensions#476

Merged
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
shimonp21:fix_yml_yaml
Dec 11, 2022
Merged

fix: Allow both 'yml' and 'yaml' extensions#476
kodiakhq[bot] merged 2 commits intocloudquery:mainfrom
shimonp21:fix_yml_yaml

Conversation

@shimonp21
Copy link
Copy Markdown
Contributor

@shimonp21 shimonp21 commented Dec 8, 2022

Summary

Fixes: cloudquery/cloudquery#5502


Use the following steps to ensure your PR is ready to be reviewed

  • Read the contribution guidelines 🧑‍🎓
  • Run go fmt to format your code 🖊
  • Lint your changes via golangci-lint run 🚨 (install golangci-lint here)
  • Update or add tests 🧪
  • Ensure the status checks below are successful ✅

@github-actions github-actions bot added the fix label Dec 8, 2022
@github-actions github-actions bot added fix and removed fix labels Dec 8, 2022
Copy link
Copy Markdown
Member

@erezrokah erezrokah 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, but maybe we can add a test for it?

@erezrokah erezrokah changed the title fix: allow both 'yml' and 'yaml' extensions fix: Allow both 'yml' and 'yaml' extensions Dec 8, 2022
@github-actions github-actions bot added fix and removed fix labels Dec 8, 2022
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 8, 2022

⏱️ Benchmark results

  • DefaultConcurrency-2 resources/s: 11,511
  • Glob-2 ns/op: 157.7
  • TablesWithChildrenDefaultConcurrency-2 resources/s: 30,440
  • BufferedScanner-2 ns/op: 9.396
  • LogReader-2 ns/op: 30.71

for _, file := range files {
if !file.IsDir() && !strings.HasPrefix(file.Name(), ".") && strings.HasSuffix(file.Name(), ".yml") {
if !file.IsDir() && !strings.HasPrefix(file.Name(), ".") &&
(strings.HasSuffix(file.Name(), ".yml") || strings.HasSuffix(file.Name(), ".yaml")) {
Copy link
Copy Markdown
Member

@disq disq Dec 8, 2022

Choose a reason for hiding this comment

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

Why not use filepath.Ext() here?

@kodiakhq kodiakhq bot merged commit 52c4c56 into cloudquery:main Dec 11, 2022
kodiakhq bot pushed a commit that referenced this pull request Dec 12, 2022
🤖 I have created a release *beep* *boop*
---


## [1.12.0](v1.11.2...v1.12.0) (2022-12-11)


### Features

* Add handling for json.Number in faker ([#481](#481)) ([ad20787](ad20787))


### Bug Fixes

* Allow both 'yml' and 'yaml' extensions ([#476](#476)) ([52c4c56](52c4c56))
* **errors:** Remove usage of `codes.Internal` ([#485](#485)) ([62692b9](62692b9))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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.

CQ config should support both .yml and .yaml files

4 participants