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

Remove _view suffix from views #466

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

yajo
Copy link
Member

@yajo yajo commented Jun 25, 2020

Views are already in views folder, so I think this is redundant.

Copy link
Member

@astirpe astirpe left a comment

Choose a reason for hiding this comment

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

I agree.
Please rename also the wizard_model_view.xml file in https://github.com/OCA/maintainer-tools/tree/master/template/module/wizards

@pedrobaeza
Copy link
Member

I don't, as when searching for files, you don't see what is (data, demo or view). Most IDEs also allow to search by file name, and the path is secondary, so I prefer the Python "explicit is better than implicit".

👎

Views are already in `views` folder, so I think this is redundant.
@yajo
Copy link
Member Author

yajo commented Aug 4, 2020

That would apply for any kind of file, not just views. Then, we'd have to name demo data demo/res_partner_demo.xml, then other data data/res_partner_data.xml and templates templates/res_partner_templates.xml.

In this gif you can see how a modern IDE such as VSCode doesn't need this _views suffix at all (you can see it highlights view from the path and res_partner from the file name). You can also see how many people are already ignoring that guideline organically; even there's one doing it the opposite: view_res_partner.xml.

Peek 04-08-2020 08-46

Also, removing the repeated word in the file path adheres to the DRY principle.

So still 👍 here.

Please rename also the wizard_model_view.xml file in https://github.com/OCA/maintainer-tools/tree/master/template/module/wizards

Fixed.

@pedrobaeza
Copy link
Member

As said, I don't like this, so 👎 for me. Your example is very specific, as you don't have long paths for it. I don't see the final folder name as my path is longer than the view.

@yajo
Copy link
Member Author

yajo commented Aug 4, 2020

Well, OK, that's +2-1=+1. Let's wait until other members vote. Thanks @pedrobaeza for your opinion!

@OCA-git-bot
Copy link

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Explained in previous comments

@pedrobaeza
Copy link
Member

Another thing to take into account: inside views folder, you can have QWeb templates for reports for the model, menus, etc, so file naming is important to highlight this: account_move_views.xml, report_account_move.xml, account_move_menu.xml, etc.

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.

5 participants