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
Add Handle Nested Language Support #6066
base: master
Are you sure you want to change the base?
Add Handle Nested Language Support #6066
Conversation
A preview of the working https://asciinema.org/a/263844 We have a test coverage of 100% 🎉 |
b51694a
to
9cebbf6
Compare
You forgot to make |
0e7b9a9
to
c4e4d5a
Compare
Doneee! Made the required changes. We now have 100% coverage on Travis 🎊 I'll work on rearranging the commits so that we have 100% on ever commit level. |
c4e4d5a
to
da2b449
Compare
This PR adds the NlSectionPosition class. NlSectionPosition class is a derived class of TextRange. It gives finer control to set the position. These include the line number and column number. This is a derived class of TextPosition Object.
This PR adds the class NlSection. In Nested Language mode, we divide the original file into various sections. These sections are called as `pure language sections` and `mixed language` sections. NlSection helps us to define these sections and also maitain the information of the start and the end position of these sections in the original file. This information helps us while linting. This has an similar implementation to that of the SourceRange of coala which is used to store the information about the affected code. This PR also has the tests for NlSection.
Regex module is used in PyJinjaParser to extract the NlSections. Hence adding this in the test-requirement.txt
Regex module is used by PyJinjaParser.
This PR adds the Parser class. Parsers are used to seperate a nested language file into various nested language sections. Parser eats up the files and spits out a list of NlSection objects that is used to identify which part of the file has which language. This is a Base Class for all the parsers that would henceforth parse nested language files.
This PR adds an Parser that can parse through a nested language file which is made up of the combination of python and jinja2 and gives out a list of NlSection Objects.
This PR, adds the arguments that will be needed to run coala in Nested language mode. The new arguments added are: 1. `--handle-nested`: Used to specify the nl mode 2. '--language1: Tells about the languages present in nl file
Add PEP8TestBear and Jinja2TestBear for running the tests on NestedLanguage files
c5cacc0
to
5cfb344
Compare
NlInfoExtractor is used to extract the information from the arguments provide when running coala in nested language mode. It extracts information such: 1. Name of languages 2. Mapping of language with it's temporary files, 3. Mapping of bear with the languages 4. Mapping of orig_files and the temporary languages NlInfoExtractor also converts the arg_list provided into args that coala can use.
This PR adds the NlFileHandler. NlFileHandler is reponsible to create the file dicts of the segreagted pure language. It is also used to preprocess the nl_file_dicts to add the position markers to the nl_file_dicts to mark the position of sections in the file.
This PR adds the NlCliParsing. NlCliParsing is used to parse the cli arguments and use the information to create cli_sections just like coala does when it receives arguments from CLI
This PR adds NlCore NlCore is the main core of the entire Nested language Architecture. This is the class with with the coala interacts with, to access an functions of Nested language. This is responsible for creating coala_nl_sections and writing the selected patches by the user to the original file. The coverage was failing for `test_apply_patches_to_nl_file` because shutil was not being to find the file. This PR mocks the `write_patches_to_orig_nl_file` function of NlCore.
This PR adds the support for nested language mode. The patches selected by the user in nested language mode is now passed onto NlCore to replace the old content of the original nested language file with the patched version. coalaTest - Add tests for Nl Mode
This PR adds the support for nested languages mode in ConsoleInteraction.py. The function have been updated to pass the nl_file_dict where the patches chosen by the user will be applied. We have also disabled printing the affected files in Nested Language Mode, since we do not physically have these files in the system.
This PR adds the support for nested language mode. It allows creation of new nl_sections when the Nested language mode is run. During the execution of instantiate_processes, we get the file_dict of the temporary files from the nested lang parsers instead of fetching it from the physical file.
This PR adds the support for the nested Language mode in Configuration Gathering. Parse the cli arguments passed to coala in Nested language mode and create coala sections.
The ResultAction and the various actions for result is updated to support Nested Language mode. The API calls have been updates with an extra argument called as `nl_file_dict`. It is to this dicitionary that the result actions will be applying the changes that the user decides to apply
5cfb344
to
38c4552
Compare
@Naveenaidu Its probably too difficult to review this PR. But if the CI passes and your mentors approve this PR, I'm happy to merge. I just think that the GSoC contributions should be considered and counted. |
For short term contributors: we understand that getting your commits well
defined like we require is a hard task and takes some learning. If you
look to help without wanting to contribute long term there's no need
for you to learn this. Just drop us a message and we'll take care of brushing
up your stuff for merge!
Checklist
them.
individually. It is not sufficient to have "fixup commits" on your PR,
our bot will still report the issues for the previous commit.) You will
likely receive a lot of bot comments and build failures if coala does not
pass on every single commit!
After you submit your pull request, DO NOT click the 'Update Branch' button.
When asked for a rebase, consult coala.io/rebase
instead.
Please consider helping us by reviewing other peoples pull requests as well:
corobo mark wip <URL>
to get it outof the review queue.
The more you review, the more your score will grow at coala.io and we will
review your PRs faster!