Skip to content

Lastride#4

Open
ishanSrt wants to merge 20 commits into
masterfrom
lastride
Open

Lastride#4
ishanSrt wants to merge 20 commits into
masterfrom
lastride

Conversation

@ishanSrt
Copy link
Copy Markdown
Owner

@ishanSrt ishanSrt commented Jul 2, 2018

No description provided.

@ishanSrt ishanSrt force-pushed the lastride branch 2 times, most recently from 5ebaa8c to 12ca4c2 Compare July 3, 2018 22:30
@codecov-io
Copy link
Copy Markdown

codecov-io commented Jul 3, 2018

Codecov Report

❗ No coverage uploaded for pull request base (master@eef7d8a). Click here to learn what that means.
The diff coverage is 93.23%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master       #4   +/-   ##
=========================================
  Coverage          ?   96.34%           
=========================================
  Files             ?       21           
  Lines             ?     1232           
  Branches          ?      304           
=========================================
  Hits              ?     1187           
  Misses            ?       41           
  Partials          ?        4
Impacted Files Coverage Δ
coala_quickstart/generation/Settings.py 100% <ø> (ø)
coala_quickstart/info_extraction/Info.py 100% <ø> (ø)
coala_quickstart/info_extraction/Utilities.py 100% <ø> (ø)
coala_quickstart/green_mode/filename_operations.py 100% <100%> (ø)
coala_quickstart/green_mode/QuickstartBear.py 100% <100%> (ø)
coala_quickstart/Constants.py 100% <100%> (ø)
coala_quickstart/generation/Utilities.py 100% <100%> (ø)
coala_quickstart/generation/SettingsFilling.py 100% <100%> (ø)
coala_quickstart/generation/SettingsClass.py 99.15% <50%> (ø)
coala_quickstart/coala_quickstart.py 96.22% <75%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update eef7d8a...bd5969d. Read the comment docs.

@ishanSrt ishanSrt force-pushed the lastride branch 5 times, most recently from 51e8c50 to 417f9e2 Compare July 12, 2018 01:35
@ishanSrt ishanSrt force-pushed the lastride branch 2 times, most recently from 0a52ee0 to 8ca7f76 Compare July 19, 2018 04:32
@ishanSrt ishanSrt force-pushed the lastride branch 9 times, most recently from 1b8fcba to 0b5a977 Compare July 28, 2018 13:58
@ishanSrt ishanSrt force-pushed the lastride branch 3 times, most recently from 0b907df to a980f5e Compare July 29, 2018 12:27
This enables us to look for .gitignore files
recursively in the subdirectories starting
from root.
Commit authored by Anshumaan Parashar (Wert1996).

Closes coala#108
@ishanSrt ishanSrt force-pushed the lastride branch 6 times, most recently from 1f8da04 to e9de7fa Compare July 31, 2018 12:19
jayvdb and others added 8 commits August 4, 2018 18:49
A TypeError was being raised if a class attribute with a default
had been set to a falsish value.  While possible, it is very
improbable, and other errors will result.
Creates a list of coverage exceptions in .nocover.yaml
which are used in setup.cfg by coverage to ignore them
while ensuring any other parts of the code are fully
tested.

Also rename one function so its signature is on one line
as required for coverage to ignore the entire function.

Closes coala#282
The local variables all_files and gitignore_files were redundant
Hence they were removed.

Closes coala#264
@ishanSrt ishanSrt force-pushed the lastride branch 4 times, most recently from 8eed16e to ef12493 Compare August 9, 2018 07:04
* Constants.py: Add GREEN_MODE_COMPATIBLE_BEAR_LIST.
  This list includes the bears from IMPORTANT_BEAR_LIST.

* Bears.py: Use this list created for --green-mode.

* tests/Bears.py: Modify tests for the above changes.

* Utilities.py: Add function `concatenate` to concatenate
  2 dicts.
Add bear_settings.yaml which creates yaml data. The SettingsClass
grouped the settings into `type_bool` i.e the ones which attain only
boolean values and `type_others` i.e. into all other kinds of
settings. This yaml file further operates on these `type_others`
settings, grouping them into:
* type4 settings: These settings specify the path to a config file
  required by the linter bears for their particular linter.
* type3 settings: These settings take some finite discrete sets of
  values. Other values will be invalid for this setting so for each
  bear the setting name is stored as key and a list of acceptable
  values as value to this setting.
* type2 settings: These settings can take on a large amount of values
  making it unfavourable for the green_mode to run coala those many
  times. These settings are guessed by QuickstartBear from the project
  itself.

Apart from these some settings for some bears are stored under random
keys such as `how_to_guess_these` and
`too_difficult_to_guess_by_file_dict_parsing`. These imply that these
settings yet type2 are still not guessed by the QuickstartBear.

The bears included in this yaml file are from Constants.py,
IMPORTANT_BEAR_LIST and GREEN_MODE_COMPATIBLE_BEAR_LIST.
Add QuickstartBear.py which traverses the `file_dict`
and returns data about bear settings that can attain an infinite
set of values and whose value can be easy extracted from the file
contents. Add tests for the same.
This file contains functions required to guess settings
regarding the names of the files. Tests are added for the
same.
This file is the center of --green-mode and contains the underlying
core of this mode of coala-quickstart.

* green_mode(): The master method which calls all the underlying
  methods in this file and many others. Some broad functions that it
  achieves:
  * Creates `.project_data.yaml` to store the directory and file
    structure of the project, deletes it in the end. Further commits
    may change this behaviour and add code to reuse this data
    generated.
  * Calls the QuickstartBear to traverse the file_dict and guess some
  	setting values on its own.
  * Calls the methods to provide some other information about settings
  	of some bears which can't be detected by traversing the file_dict
  	eg. settings based on the names of files.
  * Calls the methods to test each bear for each file for all the
    values for each setting until a green setting is found for a bear.
  * Will call the methods to create section object and write `.coafile`
  	in further commits.

* bear_test_fun(): Calls the methods to get all possible combinations
  of values to bear settings and supply these to other underlying
  methods to test them for each bear.

* run_test_on_each_bear(): Prints a message about which bear the tests
  are running on and calls local_bear_test() or global_bear_test()
  depending on the type of bear to guess the green setting values
  from the combination of all values.

* local_bear_test(), global_bear_test(): Run coala repetitevely on the
  bear in a multiprocessing environment and return the green settings
  found.

* check_bear_results(): Checks whether the result objects returned by
  the bear are 0 or if they lie in the ignore scope of the code to
  testify whether the current bear settings are green.

* get_kwargs(): Produces combinations of all setting values for the
  bears which are given one by one to the bear to run upon.

* get_type_of_setting(): Detects the type of a bear argument, i.e.
  whether it accepts boolean values or something like int which falls
  under the category of infinite set of values, whether some setting
  requires a config file of a specific linter or whether an argument
  accepts some discrete set of values.

* run_quickstartbear(): Runs QuickstartBear to guess some setting
  values from the file_dict and write the results to
  `.project_data.yaml`.

* find_min_of_setting()/find_max_of_setting(): Are helper functions
  for bear settings that run in coordination with per file results of
  QuickstartBear to get the project minima/maxima value of that
  particular setting.

* generate_complete_filename_list(): From the file/directory structure
  written to the `.project_data.yaml` gets only the list of files.

* initialize_project_data(): Initializes the `.project_data.yaml` by
  writing to the file/directory structure of the project with file
  names as items of a list but directories as dicts again as sub items
  of a list.

* Some other helper methods for some basic operations are also created.

Apart from the changes to green_mode.py a methos that is added to
Utilities.py is:

contained_in(): Detects whether the first argument which must be
a SourceRange object is contained absolutely inside the
other SourceRange object with closed boundaries.

Tests are added for each method except the final green_mode() method.

coala_quickstart.py: The argumetns:
* MAX_NUM_OF_OPTIONAL_ARGS_ALLOWED_FOR_GREEN_MODE
* MAX_NUM_OF_VALUES_OF_OPTIONAL_ARGS_ALLOWED_FOR_GREEN_MODE
are introduced.
* Constants.py: Add a list GREEN_MODE_INCOMPATIBLE_BEAR_LIST.
* Bears.py: Remove bears from REQUIRED_BEAR_LIST that are present
			in GREEN_MODE_INCOMPATIBLE_BEAR_LIST when running
			green_mode.
Add tests for the same.
* The interactive mode of coala-quickstart now asks to select
  languages too.
* The green_mode of coala-quickstart also asks to
  select languages by default. This behaviour can be overridden
  by the use of the non_interactive tag.
* Two new arguments are introduced max_args and max_values to be
  used along side the green_mode to specify the maximum amount
  of optional settings for the bears to test against and the
  maximum values that can be guessed against each optional setting
  respectively.
* Other minor changes include refactoring of some variables from
  global to local scope and addition of tests.
@ishanSrt ishanSrt force-pushed the lastride branch 9 times, most recently from b349b66 to 0f63844 Compare August 9, 2018 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants