> On Jan. 27, 2015, 11:57 p.m., Joel Hestness wrote:
> > util/sort_includes.py, line 151
> > <http://reviews.gem5.org/r/2614/diff/1/?file=43359#file43359line151>
> >
> >     This and lines 154+155 are tricky to read also. The old code was much 
> > clearer/easier to step through. Is it important for the code to be this 
> > dense?

I've cleaned up this part of the code (and added a few comments), which should 
make it more readable. We'll upload new version shortly.


> On Jan. 27, 2015, 11:57 p.m., Joel Hestness wrote:
> > util/sort_includes.py, line 75
> > <http://reviews.gem5.org/r/2614/diff/1/?file=43359#file43359line75>
> >
> >     The Python "do X if Y else Z" conditional formatting tends to be 
> > unclear and tricky to read, as is the case here. It's also quite uncommon 
> > in gem5 (in fact, I'm unable to quickly find another example in the 
> > codebase), and using it in line 61 and here mixes code style with the more 
> > standard use in analogous line 100. My preference would be to maintain the 
> > clearer and consistent use of if-conditionals already common in gem5.

This is a pretty common Python construct that is completely analogous to the 
trinary operator in C, which we use a lot. I'm inclined to say that this is a 
non-issue.


- Andreas


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviews.gem5.org/r/2614/#review5804
-----------------------------------------------------------


On Jan. 28, 2015, 11:56 a.m., Andreas Hansson wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviews.gem5.org/r/2614/
> -----------------------------------------------------------
> 
> (Updated Jan. 28, 2015, 11:56 a.m.)
> 
> 
> Review request for Default.
> 
> 
> Repository: gem5
> 
> 
> Description
> -------
> 
> Changeset 10669:e82b485546d1
> ---------------------------
> style: Update the style checker to handle new include order
> 
> As of August 2014, the gem5 style guide mandates that a source file's
> primary header is included first in that source file. This helps to
> ensure that the header file does not depend on include file ordering
> and avoids surprises down the road when someone tries to reuse code.
> 
> In the new order, include files are grouped into the following blocks:
>   * Primary header file (e.g., foo.hh for foo.cc)
>   * Python headers
>   * C system/stdlib includes
>   * C++ stdlib includes
>   * Include files in the gem5 source tree
> 
> Just like before, include files within a block are required to be
> sorted in alphabetical order.
> 
> This changeset updates the style checker to enforce the new order.
> 
> 
> Diffs
> -----
> 
>   util/sort_includes.py 3c42be107634 
>   util/style.py 3c42be107634 
> 
> Diff: http://reviews.gem5.org/r/2614/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Andreas Hansson
> 
>

_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to