-
-
Notifications
You must be signed in to change notification settings - Fork 583
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
Allow specifying project name in the dirconfig file #1801
base: master
Are you sure you want to change the base?
Conversation
* projectile.el (projectile-dirconfig-name-prefix): Add option. (projectile-project-default-project-name): Use the project name in dirconfig when given, use the directory name otherwise. (projectile-parse-dirconfig-file): Parse and return the project name as the fourth element.
* test/projectile-test.el (projectile-parse-dirconfig-file): Expect the fourth element representing the project name. This is just to make sure the tests succeed. A proper test for project names should be written.
Isn't it much easier to set a custom project name using |
|
But at the cost of adding more complexity to an already complex thing. That's why I'm a bit on the fence about this. I wonder if it won't be simpler to introduce a new file like |
Does projectile use (or intend to use) any information other than the project name? If it will also contain the projectile configuration in Besides, if we have so much information that a different projectile-specific file is necessary, I would lean more toward making |
At some point I was thinking of making some more structured configuration file to replace |
projectile.el
Outdated
@@ -1299,7 +1308,9 @@ explicitly." | |||
(defun projectile-default-project-name (project-root) | |||
"Default function used to create the project name. | |||
The project name is based on the value of PROJECT-ROOT." | |||
(file-name-nondirectory (directory-file-name project-root))) | |||
(or (let ((default-directory project-root)) | |||
(nth 3 (projectile-parse-dirconfig-file))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the project name is constantly recalculated in the modeline parsing the config file all the time can make things extremely slow. That's one more reason I'm wary about the proposed change.
* projecile.el (projectile-default-project-name): Search only for the name instead of calling `projectile-parse-dirconfig-file' everytime.
Hmm, I didn't realize just how often |
This allows specifying the project name in the .projectile file.
It is backwards compatible as the older versions will parse the name as a comment.
All tests except one that also fails on origin are passing so I marked them as such.
There should be a new test added to actually check that the project name is being
parsed properly but it can wait until the rest of the change is finalized, similarly for the
readme and the changelog.
Before submitting a PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):
eldev test
)M-x checkdoc
warnings