Web UI自动化测试框架搭建之七:代码格式

当代码要共享时,需要规范代码格式,可以去网上搜索好用的代码格式,我找到了下面的google java style


Step 1: Download the Google Java Style guide definition for Eclipse

The definition is here. (https://github.com/google/styleguide/blob/gh-pages/eclipse-java-google-style.xml)

Step 2: Add the Google Style formatter to Eclipse
  1. Opening Eclipse settings varies per OS. For example, on macOS open Eclipse -> Preferences.
  2. In the search bar on the left, type “formatter”, and select the Java -> Code Style -> Formatter menu item.

  3. Click “Import” and browse to the XML file you downloaded in Step 1.
  4. Ensure the “GoogleStyle” item is selected in the “Active profile” section.

  5. Click “OK”.
Step 3: Configure save actions to automatically format your code when saving

This is a game-changer!

  1. In the Preferences menu (same as in Step 2), type “save actions”, and select Java -> Editor -> Save Actions.

  2. Select “Perform the selected actions on save”.
  3. Select “Format source code”.
  4. Click the “Formatter” link and ensure the “GoogleStyle” formatter is selected as active.
  5. Click OK.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值