Skip to content

Conversation

@ngonsoto
Copy link
Contributor

@ngonsoto ngonsoto commented Nov 5, 2021

🎉 Thanks for submitting a pull request! 🎉

Summary

Fixes #2038

Edits to .gitignore file are not shown to the user. This PR adds a prompt if the .netlify folder is not found in the .gitignore file and asks the user if it wants to add it.

Captura de pantalla 2021-11-05 105606


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures your code follows our style guide and
    passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)
8741538e4321434fe9f765f0769c78892

@erezrokah erezrokah added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Nov 5, 2021
Copy link
Contributor

@lukasholzer lukasholzer left a comment

Choose a reason for hiding this comment

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

@ngonsoto Thank you very much for your PR and taking the time to enhance our CLI!
I want to apologize upfront for being so late with my review 😬

From a consumer perspective there is no reason why the .netlify folder should not be added to the .gitignore, or at least we don't want to promote it. As all our build outputs are there and they should not be committed.

So the user input here would be in 99% the cases a "yes" – I think we can drop it for a better user experience and instead providing a meaningful log message that we adapted the users .gitignore which is stated as solution inside the issue:

Describe the solution you'd like

When the CLI modifies .gitignore we should print a log message reflecting the change to the user

Furthermore a prompt would cause issues on the link command in the CI so we would need to adapt it with a flag to pass without asking. The simpler and better approach in my humble opinion is to informing the user.

Therefore can you please update the PR with a log message?

@ngonsoto
Copy link
Contributor Author

ngonsoto commented Dec 7, 2021

Hi @lukasholzer, no problem. I'll be updating the PR with the requested changes.

@ngonsoto ngonsoto requested a review from lukasholzer December 7, 2021 19:38
/* Not ignoring .netlify folder. Add to .gitignore */
if (!ignorePatterns || !ignorePatterns.patterns.some((pattern) => /(^|\/|\\)\.netlify($|\/|\\)/.test(pattern))) {
log()
log('Adding local .netlify folder to .gitignore file...')
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
log('Adding local .netlify folder to .gitignore file...')
log('Adding local .netlify folder to .gitignore file.')
Copy link
Contributor

@lukasholzer lukasholzer left a comment

Choose a reason for hiding this comment

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

Awesome! Thank you very much for going over and adapting the PR 🌟

@lukasholzer lukasholzer added the automerge Add to Kodiak auto merge queue label Dec 10, 2021
@kodiakhq kodiakhq bot merged commit 96e28bf into netlify:main Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Add to Kodiak auto merge queue type: feature code contributing to the implementation of a feature and/or user facing functionality

3 participants