You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Masaori Koshiba <ma...@apache.org> on 2017/06/15 23:20:46 UTC

Please format python code

Hi trafficserver-dev,

Now, all python code of ATS are formatted by autopep8 after some
discussions on some PRs (#2097 and #2121).
So, please run autopep8 before sending PRs include python code.
Especially when you're adding tests using autest.

Steps are below.

1. Install autopep8
In most cases, you can install autopep8 via pip.
```
pip install autopep8
```

2. Run autopep8
```
make autopep8
```

If you use editor's supports, please note that we're using
--max-line-lenght option with 132.
And the setting is in the setup.cfg file under the top directory of ATS.

# autopep8
https://pypi.python.org/pypi/autopep8/

Thanks,
Masaori

Re: Please format python code

Posted by Jason Kenny <jk...@yahoo-inc.com.INVALID>.
In the case of Visual Studio Code, it will just work. No setup needed as the setup.cfg has the rules to use. I believe Emac or Vim ( however you start a format command) should work as well as all that is needed is to run autopep8 under the directory with the setup.cfg in it.
Jason 

On Monday, June 19, 2017, 12:03:10 PM CDT, Derek Dagit <de...@yahoo-inc.com.INVALID> wrote:

http://editorconfig.org/
Visual Studio and IntelliJ support this directly, and other editors including VS Code, Vim, and Emacs support it with plugins.
Maybe we could standardize on editorconfig and let the plugins do the work?


-- 
Derek


On Friday, June 16, 2017, 9:18:34 AM CDT, Jason Kenny <jk...@yahoo-inc.com.INVALID> wrote:

If you are using Visual Studio Code. It should just find the setup.cfg file that controls the formatting.
Jason

On Thursday, June 15, 2017, 6:21:07 PM CDT, Masaori Koshiba <ma...@apache.org> wrote:

Hi trafficserver-dev,

Now, all python code of ATS are formatted by autopep8 after some
discussions on some PRs (#2097 and #2121).
So, please run autopep8 before sending PRs include python code.
Especially when you're adding tests using autest.

Steps are below.

1. Install autopep8
In most cases, you can install autopep8 via pip.
```
pip install autopep8
```

2. Run autopep8
```
make autopep8
```

If you use editor's supports, please note that we're using
--max-line-lenght option with 132.
And the setting is in the setup.cfg file under the top directory of ATS.

# autopep8
https://pypi.python.org/pypi/autopep8/

Thanks,
Masaori

Re: Please format python code

Posted by Derek Dagit <de...@yahoo-inc.com.INVALID>.
http://editorconfig.org/
Visual Studio and IntelliJ support this directly, and other editors including VS Code, Vim, and Emacs support it with plugins.
Maybe we could standardize on editorconfig and let the plugins do the work?


-- 
Derek


On Friday, June 16, 2017, 9:18:34 AM CDT, Jason Kenny <jk...@yahoo-inc.com.INVALID> wrote:

If you are using Visual Studio Code. It should just find the setup.cfg file that controls the formatting.
Jason

On Thursday, June 15, 2017, 6:21:07 PM CDT, Masaori Koshiba <ma...@apache.org> wrote:

Hi trafficserver-dev,

Now, all python code of ATS are formatted by autopep8 after some
discussions on some PRs (#2097 and #2121).
So, please run autopep8 before sending PRs include python code.
Especially when you're adding tests using autest.

Steps are below.

1. Install autopep8
In most cases, you can install autopep8 via pip.
```
pip install autopep8
```

2. Run autopep8
```
make autopep8
```

If you use editor's supports, please note that we're using
--max-line-lenght option with 132.
And the setting is in the setup.cfg file under the top directory of ATS.

# autopep8
https://pypi.python.org/pypi/autopep8/

Thanks,
Masaori

Re: Please format python code

Posted by Jason Kenny <jk...@yahoo-inc.com.INVALID>.
If you are using Visual Studio Code. It should just find the setup.cfg file that controls the formatting.
Jason

On Thursday, June 15, 2017, 6:21:07 PM CDT, Masaori Koshiba <ma...@apache.org> wrote:

Hi trafficserver-dev,

Now, all python code of ATS are formatted by autopep8 after some
discussions on some PRs (#2097 and #2121).
So, please run autopep8 before sending PRs include python code.
Especially when you're adding tests using autest.

Steps are below.

1. Install autopep8
In most cases, you can install autopep8 via pip.
```
pip install autopep8
```

2. Run autopep8
```
make autopep8
```

If you use editor's supports, please note that we're using
--max-line-lenght option with 132.
And the setting is in the setup.cfg file under the top directory of ATS.

# autopep8
https://pypi.python.org/pypi/autopep8/

Thanks,
Masaori