coala / coala-quickstart Goto Github PK
View Code? Open in Web Editor NEWA tool that generates an initial coala config file for you!
License: GNU Affero General Public License v3.0
A tool that generates an initial coala config file for you!
License: GNU Affero General Public License v3.0
Atleast for the process/ workflows
The email specified there is no longer available. Needs to be replaced with [email protected]
at the maintainers_emails in setup.py
It'd be better to ask user to confirm detected languages, then generate the config completely with comments.
That's way easier for him to follow.
since our setuptools is running problems, do we need a MANIFEST.in that would include requirements.txt and probably README & License?
webServices Status
webServices doesn't support all the bears presently. It doesn't support the bears which have nonoptional settings. As a solution, what we can do is run coala-quickstart on the project and get relevant bears, by running quickstart in a --relevant-bears
mode
relevant_bears = ["PEP8Bear", "PyLintBear", "SpaceConsistencyBear"]
Then ask users for the optional/non-optional settings of those bears, and send this to the backend saving it in a settings.json file.
bears_settings = {
"PEP8Bear" : {},
"PyLintBear" : {}.
"SpaceConsistencyBear" : { "use_spaces" : true }
}
Then coala-quickstart would run in --get-bears-settings = settings.json
mode, and return the frontend a coafile, with bear settings.
Users will now click a "Run coala" button (or we can do that without asking user ?) and then we run coala on the project with the generated coafile, which has optional/non optional settings for bears and thus doesn't break the module.
Essentialy, frontend will send flags to the backend which will then decide the running mode of coala-quickstart.
cc @adtac @satwikkansal Thoughts?
>>> valid_path(StringConverter("/tmp"))
'/tmp'
will lead to doctest error in case of Windows as /tmp
is not a valid directory in windows.
Change the import statements in
with corresponding from coala_utils.ContextManagers
...
Currently, this list needs to be manually updated, we can auto-generate this list to avoid so. See coala/coala#3771
Opened via gitter by @satwikkansal
Inspired by the discussion at https://gitlab.com/coala/cib/issues/8
For detailed discussion
#90 (comment)
The --dir option to receive current project directory as command line argument.
failed to run coala-quickstart --ci
and got this error :
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 659, in _build_master
ws.require(__requires__)
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 967, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 858, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (six 1.8.0 (/usr/lib/python3.4/site-packages), Requirement.parse('six>=1.9.0'), {'bandit', 'stevedore'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/coala-quickstart", line 6, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 3017, in <module>
@_call_aside
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 3003, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 3030, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 661, in _build_master
return cls._build_from_requirements(__requires__)
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 674, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 858, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (six 1.8.0 (/usr/lib/python3.4/site-packages), Requirement.parse('six>=1.9.0'), {'bandit', 'stevedore'})
Coverage is only 61% . See coala/meta#86
We need to ensure it is going up over GSoC, not down.
Codecov to the rescue.
After the CI mode has been added, there is one remaining question by quickstart: which files to ignore.
This question only appears if there is not a .gitignore
. That is git specific, which should be fixed. As a result, a workaround is to touch .gitignore
, which will create this file if it exists, and the empty file is enough. A better workaround is to use a tool to generate a better .gitignore
.
Also, the generic coala parameter --ignore
doesnt work, even if the default arg parser is used. Fixing this is probably the best way to resolve this bug.
Change the file .ci/deps.sh
so that it doesn't support python 3.3
anymore as python3.3
hasn't been supported by coala for a long time. see #35
We can have autocomplete feature with suggestions for setting values (possibly using python’s readline bindings)
I ran coala-quickstart --ci
on a project and the language statistics generated were as follows :
The following languages have been automatically detected:
C: 37%
Python: 1%
Markdown: 1%
C++: 0%`
This does not total to 100%. The language statistics for the same project on github were
C: 97.5%
Python: 2.3%
Other: 0.2%
Running linguist locally fetches the following stats :
97.47% C
2.30% Python
0.14% C++
0.09% Makefile
We should take the globs from .gitignore to ignore those files
this is a duplicate and an enhancement
I think the welcome message should be disabled when --non-interactive
is declared. Because what it does only fills the terminal especially on CI environment.
test
For continuous integration on OSX.
coala-quickstart --ci
is emitting lots of "The default coafile '.coafile' was not found." warnings
see https://travis-ci.org/jayvdb/Aurora/builds/185683597
WARNING:root:The default coafile '.coafile' was not found. You can generate a configuration file with your current options by adding the `--save` flag or suppress any use of config files with `-I`.
WARNING:root:The default coafile '.coafile' was not found. You can generate a configuration file with your current options by adding the `--save` flag or suppress any use of config files with `-I`.
WARNING:root:The default coafile '.coafile' was not found. You can generate a configuration file with your current options by adding the `--save` flag or suppress any use of config files with `-I`.
WARNING:root:The default coafile '.coafile' was not found. You can generate a configuration file with your current options by adding the `--save` flag or suppress any use of config files with `-I`.
WARNING:root:The default coafile '.coafile' was not found. You can generate a configuration file with your current options by adding the `--save` flag or suppress any use of config files with `-I`.
WARNING:root:The default coafile '.coafile' was not found. You can generate a configuration file with your current options by adding the `--save` flag or suppress any use of config files with `-I`.
WARNING:root:The default coafile '.coafile' was not found. You can generate a configuration file with your current options by adding the `--save` flag or suppress any use of config files with `-I`.
WARNING:root:The default coafile '.coafile' was not found. You can generate a configuration file with your current options by adding the `--save` flag or suppress any use of config files with `-I`.
$ rstcheck README.rst
README.rst:4: (WARNING/2) Title underline too short.
Currently, the user inputs for the values of the settings are not validated and directly are directly written in the generated ".coafile". We need a way to validate those inputs first.
status/needs design
In some project (mainly that specifically target linux platform) a file without extension is commonly found. Mainly they use shebang (!#/bin/sh
or similiar) to specify language/intrepeter used.
AFAIK, coala-quickstart just detect used language based on their extension, so they fail to detect extensionless file. Also, in .coafile
the file path need to be explicitly stated, because (ex. files = **.sh, image/base/*
).
Project example
https://github.com/discourse/discourse_docker, see this folder
Cmon, im sure it can be better than this. Some usage sections, installation, better than this logo?
a brief explanation of what it is :D ?
Gruntfile.js contains pre-existing configuration which will exist in mature projects, which can be used to create the correct .coafile
configuration. e.g. https://github.com/wikimedia/jquery.ime
jshint: {
options: {
jshintrc: true
},
all: [
'*.js',
'src/*.js',
'rules/**/*.js',
'test/**/*.js'
]
},
jscs: {
fix: {
options: {
fix: true
},
src: '<%= jshint.all %>'
},
main: {
src: '<%= jshint.all %>'
}
},
csslint: {
all: [
'css/**/*.css'
]
},
Those top level keys (csslint, jscs, jshint) are constant, and directly map to names of linters; but the sub-keys change per grunt plugin, but all
and main
are quite common. IMO quickstart should still find all relevant files, and then emit a message to say which relevant files have been excluded due to Gruntfile.js
.
There is also a common, but not standard, excerpt to correctly choose necessary linters:
grunt.registerTask( 'lint', [ 'jshint', 'jscs:main', 'csslint' ] );
It would be very nice to warn if any of the lint
sub-tasks can not be mapped to a bear in coala.
An --allow-partials-section
option to generate a coafile with useable as well as unusable bears in CI mode. Presently it only generates one with useable bears in --ci mode, ie, bears not having non optional settings)
Reference:-
#90 (comment)
f5c5dfb67646 = 0.3
as header files are associated with both
It should be possible to run this without any questions being asked.
It should make sensible decisions, and the user can edit the .coafile
later when they better understand what the config options all mean.
This will allow https://github.com/coala/coala/wiki/Google-Code-In-Task-Use-coala to be an extremely easy task.
quickstart uses coalib
, which relies heavily on the CLI and config loading routines.
get_filtered_bears
is called, and it uses load_configuration
, which calls coalib.parsing.DefaultArgParser.default_arg_parser
, which is in fact the only arg parser and all coala apps are implicitly using.
The CLI arg parsing occurs after a bit of initial interaction with the user. e.g. if we use --foo
, the error message uses the wrong program name, and shows all generic coala args as being valid.
$ coala-quickstart --foo
.o88Oo._
d8P .ooOO8bo._ Hi there! Awesome you decided to do some
88 '*Y8bo. high quality coding. coala is just the
YA '*Y8b __ tool you need!
YA 68o68**8Oo.
"8D *"' "Y8o You can configure coala to suit your
Y8 'YB .8D needs. This is done with a settings file
'8 d8' 8D called a `.coafile` in the project
8 d8888b d AY directory.
Y, d888888 d' _.oP"
q. Y8888P' d8 We can help you with that. Let's get
"q. `Y88P' d8" started with some basic questions.
Y ,o8P
oooo888P"
What is your project directory? [/tmp]
The contents of your .gitignore file for the project will be automatically loaded as the files to ignore.
The following languages have been automatically detected:
Go: 42%
C++: 8%
Python: 7%
HTML: 2%
JavaScript: 2%
C#: 1%
Java: 1%
Markdown: 1%
YAML: 0%
CSS: 0%
Ruby: 0%
PHP: 0%
XML: 0%
C: 0%
usage: coala [-h] [-v] [-c FILE] [-F] [-I] [-s [FILE]] [--disable-caching]
[--flush-cache] [-b NAME [NAME ...]] [-f FILE [FILE ...]]
[-i FILE [FILE ...]] [--limit-files FILE [FILE ...]]
[-d DIR [DIR ...]] [-V] [-L ENUM] [-m ENUM] [-B]
[-l LANG [LANG ...]] [-p LANG [LANG ...]] [-D] [--show-details]
[-S SETTING [SETTING ...]] [-a] [-j JOBS] [-n]
[TARGETS [TARGETS ...]]
coala: error: unrecognized arguments: --foo
As best I can tell, all of these options are discarded, but I am still investigating that
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.