Conversation
5ebaa8c to
12ca4c2
Compare
Codecov Report
@@ Coverage Diff @@
## master #4 +/- ##
=========================================
Coverage ? 96.34%
=========================================
Files ? 21
Lines ? 1232
Branches ? 304
=========================================
Hits ? 1187
Misses ? 41
Partials ? 4
Continue to review full report at Codecov.
|
51e8c50 to
417f9e2
Compare
0a52ee0 to
8ca7f76
Compare
1b8fcba to
0b5a977
Compare
0b907df to
a980f5e
Compare
This enables us to look for .gitignore files recursively in the subdirectories starting from root. Commit authored by Anshumaan Parashar (Wert1996). Closes coala#108
1f8da04 to
e9de7fa
Compare
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
8eed16e to
ef12493
Compare
* 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.
b349b66 to
0f63844
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.