Google Summer of Code 2017 Work Product Submission



coala

Satwik Kansal

I’m a final year Software Engineering undergrad from Delhi Technological University, New Delhi, India. I was a Google Summer of Code student for coala over the summer of 2017 and primarily worked on the tool coala-quickstart. My project involved developing an information extraction & utilization framework for project files and improving the existing CLI of quickstart.


Patches Tarball


SHA-256:

0296b7a4c12e367b0ef27c02595f93069805c69b6a3d59f3e41e64a105c7f393

Bonding

Phase 1

Phase 2

Phase 3


Links to commits and repositories I've worked on:

Repository Link to Commit/s Description
c  cEPs View

cEP 9: Extract and use information

c  coala-quickstart View

CI: Add Travis

c  coala-quickstart View

info_extraction: Add Info class

c  coala-quickstart View

info_extraction: Add InfoExtractor class

c  coala-quickstart View

Project.py: Remove OS specific doctest

c  coala-quickstart View

tests/FileGlobs.py: Normalize case for path

c  coala-quickstart View

CI: Add appveyor

c  coala-quickstart View

Info.py: Add extractor field

c  coala-quickstart View

Info.py: Validate value type

c  coala-quickstart View

InfoExtractor: Add file name field to parse method

c  coala-quickstart View

InfoExtractor: Validate supported files

c  coala-quickstart View

info_extraction: Add Info classes

c  coala-quickstart View

info_extractors: Add package.json extractor

c  coala-quickstart View

info_extractors: Extract info from Gemfile

c  coala-quickstart View

InfoExtractor: Validate information kind

c  coala-quickstart View

info_extraction: Add Info classes

c  coala-quickstart View

info_extractors: Add editorconfig extractor

c  coala-quickstart View

Info.py: Validate value with type signature

c  coala-quickstart View

.coafile: Add test files to default section

c  coala-quickstart View

InfoExtractor: Add spec_references field

c  coala-quickstart View

Info: Add example_values field.

c  cEPs View

cEP-0014: Generate relevant coafile sections

c  cEPs View

cEP-009: Change status

c  coala-quickstart View

Inforamtion: Add linter Info classes

c  coala-quickstart View

requirements.txt: Add pyjsparser

c  coala-quickstart View

info_extractor/Utilities: Add search functions

c  coala-quickstart View

info_extractors: Extract info from Gruntfile.js

c  coala-quickstart View

TestUtilities: Fix file generation

c  coala-quickstart View

InfoCollector: Collect info from project files

c  coala-quickstart View

InfoScope: Implement InfoScope class

c  coala-quickstart View

InfoMapping: Add mappings for editorconfig

c  coala-quickstart View

Settings: Autofill setting values

c  coala-quickstart View

Bears: Suggest bears using dependecy info

c  coala-quickstart View

Bears.py: Add bears based on capabilties

c  coala-quickstart View

Bears.py: Ask users for capabilities

c  coala View

SectionFilling: Allow custom fill_section method

c  coala-quickstart View

requirements.txt: Upgrade coalib version

c  coala-quickstart View

coala_quickstart: Fix errors due to logging

c  coala-quickstart View

SettingsFilling: Validate settings value type

c  coala-quickstart View

SettingsFilling: Flexible boolean input

c  coala-quickstart View

SettingsFilling: Autofill language setting

c  coala-quickstart View

Bears: Silence .coafile not found warnings

c  coala View

ConfigurationGathering: Silence warnings

c  coala-quickstart View

requirement.txt: Pin lxml version

c  coala-utils View

FilePathCompleter: Implement autocompletion

c  coala-quickstart View

requirements.txt: Upgrade coala-utils version

c  coala-quickstart View

CLI: Complete file paths with Tab

c  coala-quickstart View

EditorconfigExtractor: Update scope field

c  coala-quickstart View

InfoMapping: Check for section files

c  coala-quickstart View

Bears.py: Suggest bears based on Gruntfile.js

c  coala-utils View

FilePathcompleter: Use pyreadline for windows

c  coala-utils View

setup.py: Add missing params

c  coala-quickstart View

setup.py: Release 0.4


Enhance coala-quickstart

Work Done

coala is a modular and language-agnostic tool for performing static code analysis. coala-quickstart is a tool designed to do all the boilerplate work for coala and help users to quickly get started with coala.

Major tasks of the project:

  • Developing a framework for extracting Infromation of interest from different kinds of project files.
  • Extracting useful information from the following files:
    • Gruntfile.js
    • .editorconfig
    • package.json
    • Gemfile

    More information about each of the files can be found here

  • Utilizing the information extracted from project files to
    • Suggest static code analysis routines to users
    • Automatically identify values required for settings in .coafile (coala’s configuration file)
    • Detect inconsistencies among files
  • Recommending and Filtering static code analysis routines to users based on:
    • Capabilities selected by the users.
    • A curated list of static code analysis routines.
    • Insights about static code analysis tools already used by the project.
  • Improving the existing CLI by
    • Adding auto-complete feature for project files
    • Allowing flexibility in user input (Example: “yeah!!”, “obviously”, etc will be automatically mapped to True in boolean-type inputs)
    • Validating user inputs
  • Adding Continuous Integration support for Windows.

Check out the lateset release of coala-quickstart to see all of the above discussed features in action!

Challenges

Overall, it was a wonderful and satisfying experience.

  • The first challenge for me was to come up with a feasible and promising project on my own. Initially, I was skeptical about the utility and the usefulness of my project. But in the end, everything turned out pretty good.
  • I was also doing an internship, so the biggest challenge for me was to manage my time accordingly. There were some moments, when it felt like it’s gonna be difficult to complete my tasks and deliver a useful solution, but the weekly meetings with Adhityaa(which lasted somewhere between 15 minutes to 2+ hrs) really helped me plan everything much ahead of time. Good planning and initial discussion made the code review and merge process much easier for my mentors.
  • Development wise, the challanges were to design and document my approach in the cEPs (implementation was very smooth after that), and to make all the CIs work together at once :P (Thanks to John for helping me in some of the issues related to CI)

Work to be done

There’s still a long way to go for coala-quickstart and the most important thing to watch out for is the aspects project which will simplify the configurations for the users to a lot extent. So, once the aspects project is completely ready, the first step should be to integrate aspects into quickstart.

Apart from that, there’s also scope to extract useful information from meta files like Gulpfile.js, requirements.txt, etc which were not covered in my project. Finally, some minor features and improvements are also discussed in these issues.

Thanks giving!

Thanks a lot to all my fellow coalians for making my so far wonderful journey with coala. It’s been around 9 months since I started contributing to coala and I’ve learned a lot till now. A very very special thanks to Adhityaa for helping me constantly throughout the summer despite of his own internship. He was quick in doing critical code reviews and absolutely a fun mentor to work with (not to mention the interesting conversations between Adrian and him during the initial weekly meetings).

I’ll definitely keep on contributing to coala-quickstart and coala in general after my GSoC.