https://github.com/craigsdennis/taste
Get a taste of a code base
https://github.com/craigsdennis/taste
aggregator ast javascript parser
Last synced: 8 months ago
JSON representation
Get a taste of a code base
- Host: GitHub
- URL: https://github.com/craigsdennis/taste
- Owner: craigsdennis
- Created: 2017-08-21T04:40:45.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-24T07:27:57.000Z (almost 9 years ago)
- Last Synced: 2024-12-28T00:20:17.057Z (over 1 year ago)
- Topics: aggregator, ast, javascript, parser
- Language: JavaScript
- Size: 18.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Taste
Run this over your codebase and produce a overview to share with others.
This is very, very rough at the moment. t**AST**e, get it?
## Flavor Profiles
The idea is that you can run different flavor profiles to help define specific technology.
### counts
Gathers counts of matches
Here is a snippet from [the flavor profile for es6](flavor_profiles/javascript/es6.json)
```json
{
"name": "es6 usage",
"counts": [
{
"name": "forEach",
"query": "call[callee=member[prop=#forEach]]"
},
```
And JSON will produced from running over a codebase using that profile. Counts will gather and count occurrences of matching nodes across files.
```json
{
"es6 usage": {
"counts": {
"forEach": 4,
```
#### values
Pulls values from AST and produces a unique list of sorted values
Here is a snippet from [the flavor profile for imports](flavor_profiles/javascript/imports.json)
```json
{
"name": "Imported",
"values": [
{
"name": "external requires",
"query": "call[callee=#require] str[value~=/^[^.]/]"
},
```
And the results all require statements in the codebase that are external (do not start with a .)
```json
"Imported": {
"values": {
"external requires": [
"assert",
"events",
"fs",
"fs.realpath",
"inflight",
"inherits",
"minimatch",
"once",
"path",
"path-is-absolute",
"util"
],
```
## TODO
- [x] Support globs
- [ ] Add better ignoring
- [ ] Support multiple languages by pluggable Tasters for querying AST.
- [x] Allow profiles to specify taster, but fallback to the default.
## Contributing
Not quite yet...but if you are interested, give me a ping.