Skip to content

Conversation

@Karanjot786
Copy link

Description

This PR adds new snippet files for the Fibonacci series in multiple programming languages, each placed under the appropriate folders and following the guidelines from the CONTRIBUTING.md. Specifically, it includes:

  • C – Iterative function in snippets/c/basic/fibonacci-series.md
  • C++ – Iterative function in snippets/cpp/basic/fibonacci-series.md
  • C# – Iterative function in snippets/csharp/basic/fibonacci-series.md
  • Python – Iterative function in snippets/python/basic/fibonacci-series.md
  • Java – Iterative function in snippets/java/basic/fibonacci-series.md
  • JavaScript – Iterative function in snippets/javascript/basic/fibonacci-series.md
  • Rust – Iterative function in snippets/rust/basic/fibonacci-series.md

Each snippet has:

  1. A front matter section with title, description, tags, and author.
  2. A simple iterative implementation of Fibonacci.
  3. An example usage showing how to call the function and an expected output.

Fix for Workflow Error

Additionally, this PR fixes a workflow error where the GitHub Actions job fails with an exit code of 1 if there are no changes to commit in the public/consolidated or public/icons directories.

Type of Change

  • ✨ New snippet
  • 🛠 Improvement to an existing snippet
  • 🐞 Bug fix
  • 📖 Documentation update
  • 🔧 Other (please describe):

Checklist

  • I have tested my code and verified it works as expected.
  • My code follows the style and contribution guidelines of this project.
  • Comments are added where necessary for clarity.
  • Documentation has been updated (if applicable).
  • There are no new warnings or errors from my changes.

Related Issues

Closes #

Additional Context

Screenshots (Optional)

Click to view screenshots

@Mathys-Gasnier
Copy link
Collaborator

Mathys-Gasnier commented Jan 5, 2025

Hey, Thank you for your contribution.

After reviewing we notice that your PR doesn't follow our guidelines.

  • Your snippets don't return any value instead they print them
  • The C and C++ snippets are pretty much the same
  • Some snippets already exists to calculate fibonacci
  • You modify the workflow in a snippet PR
  • Normally we also like to avoid having multiple languages in the same PR, but as this has only one type of snippet it's not that bad.

You can find them in CONTRIBUTING.md in the root of the repo. If you have any question or want to contest this decision please send a message in your PR explaining your position.

If no fix is provided within 7-10 days this PR will be closed without further notice

@Karanjot786
Copy link
Author

Hi @Mathys-Gasnier,

Thank you for taking the time to review my PR. I appreciate the detailed feedback.

Snippets Returning vs. Printing

  • I can update each snippet to return the Fibonacci value instead of printing it. That way, it aligns with the project’s guidelines to return a result rather than produce console output.

C and C++ Snippets

  • Yes, they appear very similar, but I included both because the syntax and file extensions differ between the two languages. Please let me know if you’d prefer a single snippet or a different approach.

Existing Fibonacci Snippets

  • I couldn’t find any existing Fibonacci snippets in the repo. Could you please point me in the right direction or provide a link? I’d be happy to remove duplicates or update mine to avoid overlap if they exist.

Workflow Changes

  • I’ll remove the workflow changes from this PR. I understand that changes to the workflow should be in a dedicated PR, so I’ll open a separate one for that.

Multiple Languages in One PR

  • Since these are the same snippet concepts in different languages, I added them together. However, if you prefer separate PRs for each language in the future, please let me know, and I’ll adjust my approach.

Please let me know if you have any further suggestions or need clarifications. If you can direct me to where the existing Fibonacci snippets are located, I’ll ensure my changes adhere to the existing code.

Thank you again for your guidance, and I look forward to making the necessary revisions!

@technoph1le
Copy link
Collaborator

Hey, there! Thanks for the contribution.

After reviewing your snippets, we realized that we can't accept them. Fibonacci is more of an algorithm rather than a code snippet. And, the problem with algorithms is that they can be applied in every language, which creates duplicates like in this case. Therefore, it doesn't fit the scope of QuickSnip.

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.

4 participants