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

dvc: use ' to mark dynamic command output, et al. #2986

Merged
merged 8 commits into from
Dec 21, 2019
Merged

dvc: use ' to mark dynamic command output, et al. #2986

merged 8 commits into from
Dec 21, 2019

Conversation

jorgeorpinel
Copy link
Contributor

@jorgeorpinel jorgeorpinel commented Dec 19, 2019

Follow-up of #2644 and #2644

@efiop it seems to me we still have dynamic output without ' around it, am I right or have I not completely understood the criteria you use yet? Thanks

UPDATE: The criteria I have kind of deduced at this point is to only wrap with ' dynamic output (logger.info/warning mainly) in larger messages, not when the entire (or almost) string or line is dynamic, when it's the last part of the string/line/sentence? after : (e.g. like in dvc version), or when it wouldn't make sense for some other reason (like in involved formatted strings). Also noting that these dynamic parts of the output typically come from variable user input (e.g. file names), not necessarily predefined variables (e.g. remote types).


  • ❗ Have you followed the guidelines in the Contributing to DVC list?

  • 📖 Check this box if this PR does not require documentation updates, or if it does and you have created a separate PR in dvc.org with such updates (or at least opened an issue about it in that repo). Please link below to your PR (or issue) in the dvc.org repo.

  • ❌ Have you checked DeepSource, CodeClimate, and other sanity checks below? We consider their findings recommendatory and don't expect everything to be addressed. Please review them carefully and fix those that actually improve code or fix bugs.

Thank you for the contribution - we'll try to review it as soon as possible. 🙏

@jorgeorpinel jorgeorpinel changed the title dvc: use ' for dynamic output and ` for DVC names (follow-up) dvc: use ' to mark dynamic command output Dec 19, 2019
@jorgeorpinel
Copy link
Contributor Author

jorgeorpinel commented Dec 19, 2019

The changes so far are just a sample of the first instances I found/fixed.

Note to self: using grep regex ".*([^']\{)

@jorgeorpinel jorgeorpinel added the question I have a question? label Dec 19, 2019
@jorgeorpinel jorgeorpinel changed the title dvc: use ' to mark dynamic command output dvc: use ' to mark dynamic command output? Dec 19, 2019
@jorgeorpinel jorgeorpinel changed the title dvc: use ' to mark dynamic command output? dvc: use ' to mark dynamic command output Dec 19, 2019
@efiop
Copy link
Contributor

efiop commented Dec 20, 2019

@jorgeorpinel Looks good! Please install our hooks and fix the tests that depend on the messages that you've changed.

@jorgeorpinel jorgeorpinel changed the title dvc: use ' to mark dynamic command output [WIP] dvc: use ' to mark dynamic command output Dec 20, 2019
@jorgeorpinel
Copy link
Contributor Author

Ah yeah sorry I should've checked that. I'll fix them, finish wrapping dynamic output with ', and re-request your reviews. Thanks!

@jorgeorpinel
Copy link
Contributor Author

jorgeorpinel commented Dec 20, 2019

Interesting @efiop @shcheklein so Restyled can't always make a PR into the original PR branch. Have you found this problematic Ruslan? Seems a bit confusing:

Since the original Pull Request was opened as a fork in a contributor's
repository, we are unable to create a Pull Request branching from it with only
the style fixes.

See #2987

@jorgeorpinel
Copy link
Contributor Author

OK guys I fixed the formatting (and fixed the pre-hook) and continued down with this down to all commands, but still have many places in the rest of the code to double check. Probably won't find many more instances but maybe you want to review my latest changes so each review is small? Note that this is still WIP please, please don't merge it yet.

@jorgeorpinel jorgeorpinel requested review from pared and efiop December 21, 2019 00:51
@jorgeorpinel jorgeorpinel changed the title [WIP] dvc: use ' to mark dynamic command output [WIP] dvc: use ' to mark dynamic command output, et al. Dec 21, 2019
@jorgeorpinel jorgeorpinel changed the title [WIP] dvc: use ' to mark dynamic command output, et al. dvc: use ' to mark dynamic command output, et al. Dec 21, 2019
@jorgeorpinel
Copy link
Contributor Author

OK well I'm done here now actually 😬 Pending your reviews, of course.

@efiop efiop merged commit dd68e9a into iterative:master Dec 21, 2019
@efiop
Copy link
Contributor

efiop commented Dec 21, 2019

Thank you @jorgeorpinel ! 🙏

@jorgeorpinel jorgeorpinel deleted the output/format/single-quotes branch October 11, 2020 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question I have a question?
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants