-
Notifications
You must be signed in to change notification settings - Fork 7
Docs Update #12
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
Open
AsnelChristian
wants to merge
2
commits into
coala:master
Choose a base branch
from
AsnelChristian:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Docs Update #12
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
+---------------------------------------+----------------------------+------------------------------------------------------------------+ | ||
| ``Root.Formatting.Length.FileLength`` | `Parent <../README.rst>`_ | `Index <//github.com/coala/aspect-docs/blob/master/README.rst>`_ | | ||
+---------------------------------------+----------------------------+------------------------------------------------------------------+ | ||
|
||
|
||
+---------------------+------------------------------------------+ | ||
| **Sibling aspects** | `LineLength <../LineLength/README.rst>`_ | | ||
+---------------------+------------------------------------------+ | ||
|
||
FileLength | ||
========== | ||
Number of lines found in a file. | ||
|
||
Tastes | ||
======== | ||
|
||
+--------------------+-----------------------------------+-----------------------------------+ | ||
| Taste | Meaning | Values | | ||
+====================+===================================+===================================+ | ||
| | | | | ||
|``max_file_length`` | Maximum number of line for a file | **999** + | ||
| | | | | ||
+--------------------+-----------------------------------+-----------------------------------+ | ||
|
||
|
||
\* bold denotes default value | ||
|
||
Subaspects | ||
========== | ||
|
||
This aspect does not have any sub aspects. | ||
|
||
Example | ||
======= | ||
|
||
.. code-block:: Python 3 | ||
|
||
# This file would be a large file if we assume that the max number of | ||
# lines per file is 10 | ||
|
||
class Node: | ||
def __init__(self, value, left_most_child, left_sibling): | ||
self.value=value | ||
self.left_most_child=left_most_child | ||
self.left_sibling=left_sibling | ||
|
||
# This is example is just showing what this aspect is about, because | ||
# the max number of lines per file is usually 999. | ||
|
||
|
||
Importance | ||
========== | ||
|
||
Too long programs (or files) are difficult to read, maintain and | ||
understand. | ||
|
||
How to fix this | ||
========== | ||
|
||
Splitting files into modules, writing shorter methods and classes. | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
+---------------------------------------+----------------------------+------------------------------------------------------------------+ | ||
| ``Root.Formatting.Length.LineLength`` | `Parent <../README.rst>`_ | `Index <//github.com/coala/aspect-docs/blob/master/README.rst>`_ | | ||
+---------------------------------------+----------------------------+------------------------------------------------------------------+ | ||
|
||
|
||
+---------------------+------------------------------------------+ | ||
| **Sibling aspects** | `FileLength <../FileLength/README.rst>`_ | | ||
+---------------------+------------------------------------------+ | ||
|
||
LineLength | ||
========== | ||
Number of characters found in a line of code. | ||
|
||
Tastes | ||
======== | ||
|
||
+--------------------+-----------------------------------------+-----------------------------------------+ | ||
| Taste | Meaning | Values | | ||
+====================+=========================================+=========================================+ | ||
| | | | | ||
|``max_line_length`` | Maximum number of character for a line. | **80**, 79, 100, 120, 160 + | ||
| | | | | ||
+--------------------+-----------------------------------------+-----------------------------------------+ | ||
|
||
|
||
\* bold denotes default value | ||
|
||
Subaspects | ||
========== | ||
|
||
This aspect does not have any sub aspects. | ||
|
||
Example | ||
======= | ||
|
||
.. code-block:: | ||
|
||
print('The length of this line is 38') | ||
|
||
|
||
Importance | ||
========== | ||
|
||
Too long lines make code very difficult to read and maintain. | ||
|
||
How to fix this | ||
========== | ||
|
||
Splitting long lines of code into multiple shorter lines whenever | ||
possible. Avoiding the usage of in-line language specific constructs | ||
whenever they result in too long lines. | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
+----------------------------+----------------------------+------------------------------------------------------------------+ | ||
| ``Root.Formatting.Length`` | `Parent <../README.rst>`_ | `Index <//github.com/coala/aspect-docs/blob/master/README.rst>`_ | | ||
+----------------------------+----------------------------+------------------------------------------------------------------+ | ||
|
||
|
||
+---------------------+----------------------------------------+------------------------------------+ | ||
| **Sibling aspects** | `Quotation <../Quotation/README.rst>`_ | `Spacing <../Spacing/README.rst>`_ | | ||
+---------------------+----------------------------------------+------------------------------------+ | ||
|
||
Length | ||
====== | ||
Hold sub-aspects for file and line length. | ||
|
||
Subaspects | ||
========== | ||
|
||
* `FileLength <FileLength/README.rst>`_ | ||
* `LineLength <LineLength/README.rst>`_ | ||
Example | ||
======= | ||
|
||
.. code-block:: Python | ||
|
||
# We assume that the maximum number of characters per line is 10 | ||
# and that the maximum number of lines per files is 3. | ||
|
||
def run(bear, file, filename, aspectlist): | ||
return bear.run(file, filename, aspectlist) | ||
|
||
|
||
Importance | ||
========== | ||
|
||
Too long lines of code and too large files result in code difficult to | ||
read, understand and maintain. | ||
|
||
How to fix this | ||
========== | ||
|
||
Length issues can be fixed by writing shorter lines of code (splitting | ||
long lines into multiple shorter lines); writing shorter files | ||
(splitting files into modules, writing shorter methods and classes.). | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
+-------------------------------+----------------------------+------------------------------------------------------------------+ | ||
| ``Root.Formatting.Quotation`` | `Parent <../README.rst>`_ | `Index <//github.com/coala/aspect-docs/blob/master/README.rst>`_ | | ||
+-------------------------------+----------------------------+------------------------------------------------------------------+ | ||
|
||
|
||
+---------------------+----------------------------------+------------------------------------+ | ||
| **Sibling aspects** | `Length <../Length/README.rst>`_ | `Spacing <../Spacing/README.rst>`_ | | ||
+---------------------+----------------------------------+------------------------------------+ | ||
|
||
Quotation | ||
========= | ||
Quotation mark used for strings and docstrings. | ||
|
||
Tastes | ||
======== | ||
|
||
+------------------------+------------------------------------+------------------------------------+ | ||
| Taste | Meaning | Values | | ||
+========================+====================================+====================================+ | ||
| | | | | ||
|``preferred_quotation`` | Represents the preferred quotation | **'**, " + | ||
| | | | | ||
+------------------------+------------------------------------+------------------------------------+ | ||
|
||
|
||
\* bold denotes default value | ||
|
||
Subaspects | ||
========== | ||
|
||
This aspect does not have any sub aspects. | ||
|
||
Example | ||
======= | ||
|
||
.. code-block:: Python | ||
|
||
# Here is an example of code where both '' and "" quotation mark | ||
# Are used. | ||
|
||
string = 'coala is always written with lowercase c.' | ||
string = "coala is always written with lowercase c." | ||
|
||
|
||
Importance | ||
========== | ||
|
||
Using the same quotation whenever possible in the code, improve on its | ||
readability by introducing consistency. | ||
|
||
How to fix this | ||
========== | ||
|
||
Choosing a preferred quotation and using it everywhere (if possible). | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
+---------------------+----------------------------+------------------------------------------------------------------+ | ||
| ``Root.Formatting`` | `Parent <../README.rst>`_ | `Index <//github.com/coala/aspect-docs/blob/master/README.rst>`_ | | ||
+---------------------+----------------------------+------------------------------------------------------------------+ | ||
|
||
|
||
+---------------------+--------------------------------------+------------------------------------------+--------------------------------------+--------------------------------+--------------------------------------+ | ||
| **Sibling aspects** | `Metadata <../Metadata/README.rst>`_ | `Redundancy <../Redundancy/README.rst>`_ | `Security <../Security/README.rst>`_ | `Smell <../Smell/README.rst>`_ | `Spelling <../Spelling/README.rst>`_ | | ||
+---------------------+--------------------------------------+------------------------------------------+--------------------------------------+--------------------------------+--------------------------------------+ | ||
|
||
Formatting | ||
========== | ||
The visual appearance of source code. | ||
|
||
Subaspects | ||
========== | ||
|
||
* `Length <Length/README.rst>`_ | ||
* `Quotation <Quotation/README.rst>`_ | ||
* `Spacing <Spacing/README.rst>`_ | ||
Example | ||
======= | ||
|
||
.. code-block:: Python | ||
|
||
# Here is an example of Python code with lots of | ||
# formatting issues including: trailing spaces, missing spaces | ||
# around operators, strange and inconsistent indentation etc. | ||
|
||
z = 'hello'+'world' | ||
def f ( a): | ||
pass | ||
|
||
|
||
Importance | ||
========== | ||
|
||
A coding style (the of rules or guidelines used when writing the | ||
source code) can drastically affect the readability, and | ||
maintainability of a program and might as well introduce bugs. | ||
|
||
How to fix this | ||
========== | ||
|
||
Defining a clearly and thoughtful coding style (based on the available | ||
ones given the programming language in use) and strictly respect it or | ||
apply it through out the implementation of a project. | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
blank line above this.
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.
this is automatically generated, do you want me to modify the function that generates it
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.
yes please.
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.
Done 👍