Skip to content

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
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 66 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,45 @@ This repository is automatically generated. To do so, run ``./generate``. This w

The aspect tree is given below:

- `Formatting <Root/Formatting/README.rst>`_


- `Length <Root/Formatting/Length/README.rst>`_


- `FileLength <Root/Formatting/Length/FileLength/README.rst>`_


- `LineLength <Root/Formatting/Length/LineLength/README.rst>`_


- `Quotation <Root/Formatting/Quotation/README.rst>`_


- `Spacing <Root/Formatting/Spacing/README.rst>`_


- `BlankLine <Root/Formatting/Spacing/BlankLine/README.rst>`_


- `BlankLineAfterClass <Root/Formatting/Spacing/BlankLine/BlankLineAfterClass/README.rst>`_


- `BlankLineAfterDeclaration <Root/Formatting/Spacing/BlankLine/BlankLineAfterDeclaration/README.rst>`_


- `BlankLineAfterProcedure <Root/Formatting/Spacing/BlankLine/BlankLineAfterProcedure/README.rst>`_


- `NewlineAtEOF <Root/Formatting/Spacing/BlankLine/NewlineAtEOF/README.rst>`_


- `SpacesAroundOperator <Root/Formatting/Spacing/SpacesAroundOperator/README.rst>`_


- `TrailingSpace <Root/Formatting/Spacing/TrailingSpace/README.rst>`_


- `Metadata <Root/Metadata/README.rst>`_


Expand Down Expand Up @@ -80,9 +119,21 @@ The aspect tree is given below:
- `ClassSmell <Root/Smell/ClassSmell/README.rst>`_


- `ClassLength <Root/Smell/ClassSmell/ClassLength/README.rst>`_
- `ClassSize <Root/Smell/ClassSmell/ClassSize/README.rst>`_


- `ClassConstants <Root/Smell/ClassSmell/ClassSize/ClassConstants/README.rst>`_


- `ClassInstanceVariables <Root/Smell/ClassSmell/ClassSize/ClassInstanceVariables/README.rst>`_


- `ClassLength <Root/Smell/ClassSmell/ClassSize/ClassLength/README.rst>`_


- `ClassMethods <Root/Smell/ClassSmell/ClassSize/ClassMethods/README.rst>`_


- `DataClump <Root/Smell/ClassSmell/DataClump/README.rst>`_


Expand All @@ -92,18 +143,30 @@ The aspect tree is given below:
- `Complexity <Root/Smell/Complexity/README.rst>`_


- `CylomaticComplexity <Root/Smell/Complexity/CylomaticComplexity/README.rst>`_


- `MaintainabilityIndex <Root/Smell/Complexity/MaintainabilityIndex/README.rst>`_


- `MethodSmell <Root/Smell/MethodSmell/README.rst>`_


- `MethodLength <Root/Smell/MethodSmell/MethodLength/README.rst>`_


- `ParameterListLength <Root/Smell/MethodSmell/ParameterListLength/README.rst>`_


- `Naming <Root/Smell/Naming/README.rst>`_


- `Spelling <Root/Spelling/README.rst>`_


- `aspectsYEAH <Root/Spelling/aspectsYEAH/README.rst>`_
- `DictionarySpelling <Root/Spelling/DictionarySpelling/README.rst>`_


- `coalaCorrect <Root/Spelling/coalaCorrect/README.rst>`_
- `OrgSpecificWordSpelling <Root/Spelling/OrgSpecificWordSpelling/README.rst>`_


61 changes: 61 additions & 0 deletions Root/Formatting/Length/FileLength/README.rst
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.

52 changes: 52 additions & 0 deletions Root/Formatting/Length/LineLength/README.rst
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.

43 changes: 43 additions & 0 deletions Root/Formatting/Length/README.rst
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.).

55 changes: 55 additions & 0 deletions Root/Formatting/Quotation/README.rst
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).

47 changes: 47 additions & 0 deletions Root/Formatting/README.rst
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
Copy link
Member

Choose a reason for hiding this comment

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

blank line above this.

Copy link
Member Author

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

Copy link
Member

Choose a reason for hiding this comment

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

yes please.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done 👍

=======

.. 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.

Loading