Repository navigation
New command: cz init #57
Description
Activity
- added 5 commits that reference this issue
on Nov 19, 2019 I'm working on it.
init_commandIt seems to me adding "name" in the init step is also a reasonable option.
Currently, I'm not sure how "files" should be implemented. Do a text search no the whole project to find version is defined in which files do not seem to be a good way.Reacted by Santiago Fraire WillemoesYes, the name should be added, and should use as options the available rules (even the plugins). It shouldn't be a problem
We could search in the current directory and inside a folder called
srcor like the project name (for this project would becommitizen), and make it not recursively.. src/ commitizen/And in the future if we found it can be improved we improve it.
But I think with this we would cover a lot of projects in different langugaes.Reacted by Wei LeeIt seems to me we might refactor part of the config so that this enhancement can be finished. One of the problems I encounter now is that I'm not able to distinguish the default config and config load from files.
My Initial thought is to have aBaseConfigabstract class,DefaultConfig,TomlConfig. The difference in each child class will be how to parse config so that we might be able to support other common data formats. I thinkjsonwould be a good choice. It's commonly used and not as hard to handle asinidoes.As for the
version_files, do you mean code likeglob.glob('*version*')andglob.glob(*/*version*)?Reacted by Santiago Fraire WillemoesFine by me, let's give it a try, I think the config part needs some love.
Regarding the
version_filesI was thinking more like:ls src/ls .ls commitizen(maybe usingos.walkoros.listdir)- Get the files only (ignore directories).
- Search for the
current_version(selected in the first step), inside the files. This doesn't need to be super fast, we can show aSearching for version files...with some sort of animation. It could be a function yielding the files found with a timeout of 5 secs.
Edit: it's also something that doesn't need to be in the first version of
initMaybe we can discuss more on the "vesrion_files" part in the future, I'll first work on the refactoring and other functionaility of
init.Reacted by Santiago Fraire Willemoes- added 8 commits that reference this issue
on Dec 25, 2019 Released on
1.12.0🎉Reacted by Wei Lee@woile Isn't
initmissing from the top level readme? It also seems to be missing when running -h ?Indeed it's missing in the README, but it works fine with
-h. Check that you have the latest versionpython3 -m pip install -U commitizen@woile Apologies I hadn't refreshed the install to get the
-hworking. Doh!
Goal
Make it easier for users to use commitizen
Description
Let's suppose we have an already existing repo without commitizen.
The user types
cz initand we try to be smart and detect some information:versionin[tool.commitizen].vor not and define thetag_formatin[tool.commitizen]filesin[tool.commitizen], we could let the user choose which files from the found should be added (with a multi-choice from questionary).This is my initial draft, I'm not sure what else could be detected. Potentially we could ask for every configuration, but it's important to keep it short. It's not about customizing, but initializing quickly. If the user wants to customize more -> read the docs.