Skip to content

Commit

Permalink
Fix all formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lumaxis authored May 6, 2024
1 parent ad03556 commit 1faa1dd
Show file tree
Hide file tree
Showing 149 changed files with 1,451 additions and 1,334 deletions.
4 changes: 1 addition & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
// Place your settings in this file to overwrite default and user settings.
{
"jshint.options": {
"esnext": true
},
"editor.folding": false,
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.detectIndentation": false,
"editor.formatOnSave": false,
"editor.formatOnType": true,
Expand Down
20 changes: 10 additions & 10 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The ClearlyDefined project welcomes your suggestions and contributions! Before o

## Contribution Licensing

Most of our code is distributed under the terms of the [MIT license](LICENSE), and when you contribute code that you wrote to our repositories,
Most of our code is distributed under the terms of the [MIT license](LICENSE), and when you contribute code that you wrote to our repositories,
you agree that you are contributing under those same terms. In addition, by submitting your contributions you are indicating that
you have the right to submit those contributions under those terms.

Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,20 @@ Process the source, if any:
The crawler's output is stored for use by the rest of the ClearlyDefined infrastructure -- it is not intended to be used directly by humans. Note that each tool's output is stored separately and the results of processing the component and the component source are also separated.

### <a id="more-on-type"></a>More on `type`

The `type` in the request object typically corresponds to an internal processor in CD.
1. `component` is the most generic type. Internally, it is converted to a `package` or `source` request by the component processor.
2. `package` request is processed by the package processor and is further converted to a request with a specific type (`crate`, `deb`, `gem`, `go`, `maven`, `npm`, `nuget`, `composer`, `pod`, `pypi`). For a `package` typed request, if the mentioned specific binary package type is known, the specific type (e.g. `npm`) can be used (instead of `package`) in the harvest request and skip the conversion step. For example,

1. `component` is the most generic type. Internally, it is converted to a `package` or `source` request by the component processor.
2. `package` request is processed by the package processor and is further converted to a request with a specific type (`crate`, `deb`, `gem`, `go`, `maven`, `npm`, `nuget`, `composer`, `pod`, `pypi`). For a `package` typed request, if the mentioned specific binary package type is known, the specific type (e.g. `npm`) can be used (instead of `package`) in the harvest request and skip the conversion step. For example,

```json
{
"type": "npm",
"url": "cd:/npm/npmjs/-/redie/0.3.0"
}
```
3. `source` requests are processed by the source processor, which subsequently dispatches a `clearlydefined` typed request for the supported source types and other requests (one for each scanning tool). These are the more advanced scenarios where the request type and the coordinate type differ.

3. `source` requests are processed by the source processor, which subsequently dispatches a `clearlydefined` typed request for the supported source types and other requests (one for each scanning tool). These are the more advanced scenarios where the request type and the coordinate type differ.

# Configuration

Expand Down Expand Up @@ -238,7 +242,8 @@ Make sure you started the container with the 5000 port forwarded for this to wor
-X POST \
http://crawler:5000/requests

On windows:
On Windows:

curl -d "{\"type\":\"npm\", \"url\":\"cd:/npm/npmjs/-/redie/0.3.0\"}" -H "Content-Type: application/json" -H "X-token: secret" -X POST http://localhost:5000/requests

Expose dashboard port:
Expand Down
40 changes: 20 additions & 20 deletions config/cdConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ const config = require('painless-config')

const cd_azblob = {
connection: config.get('CRAWLER_AZBLOB_CONNECTION_STRING'),
container: config.get('CRAWLER_AZBLOB_CONTAINER_NAME')
container: config.get('CRAWLER_AZBLOB_CONTAINER_NAME'),
}

const githubToken = config.get('CRAWLER_GITHUB_TOKEN')

const cd_file = {
location: config.get('FILE_STORE_LOCATION') || (process.platform === 'win32' ? 'c:/temp/cd' : '/tmp/cd')
location: config.get('FILE_STORE_LOCATION') || (process.platform === 'win32' ? 'c:/temp/cd' : '/tmp/cd'),
}
const crawlerStoreProvider = config.get('CRAWLER_STORE_PROVIDER') || 'cd(file)'
const maxRequeueAttemptCount = config.get('CRAWLER_MAX_REQUEUE_ATTEMPTS') || 5
Expand All @@ -22,20 +22,20 @@ module.exports = {
searchPath: [module],
crawler: {
count: 2,
maxRequeueAttemptCount
maxRequeueAttemptCount,
},
filter: {
provider: 'filter',
filter: {}
filter: {},
},
fetch: {
dispatcher: 'cdDispatch',
cdDispatch: {
fetched: { defaultTtlSeconds: fetchedCacheTtlSeconds }
fetched: { defaultTtlSeconds: fetchedCacheTtlSeconds },
},
cocoapods: { githubToken },
conda: {
cdFileLocation: cd_file.location
cdFileLocation: cd_file.location,
},
cratesio: {},
debian: { cdFileLocation: cd_file.location },
Expand All @@ -48,7 +48,7 @@ module.exports = {
nuget: {},
packagist: {},
pypi: {},
rubygems: {}
rubygems: {},
},
process: {
cdsource: {},
Expand All @@ -60,7 +60,7 @@ module.exports = {
debsrc: {},
fossology: {
disabled: true,
installDir: config.get('FOSSOLOGY_HOME') || '/mnt/c/git/fo/fossology/src/'
installDir: config.get('FOSSOLOGY_HOME') || '/mnt/c/git/fo/fossology/src/',
},
gem: { githubToken },
go: { githubToken },
Expand Down Expand Up @@ -90,39 +90,39 @@ module.exports = {
'--classify',
'--generated',
'--summary',
'--summary-key-files'
'--summary-key-files',
// '--quiet'
],
timeout: 1000,
processes: 2,
format: '--json-pp'
format: '--json-pp',
},
source: {},
top: { githubToken }
top: { githubToken },
},
store: {
dispatcher: crawlerStoreProvider,
cdDispatch: {},
webhook: {
url: config.get('CRAWLER_WEBHOOK_URL') || 'http://localhost:4000/webhook',
token: config.get('CRAWLER_WEBHOOK_TOKEN')
token: config.get('CRAWLER_WEBHOOK_TOKEN'),
},
azqueue: {
connectionString: cd_azblob.connection,
queueName: config.get('CRAWLER_HARVESTS_QUEUE_NAME') || 'harvests'
queueName: config.get('CRAWLER_HARVESTS_QUEUE_NAME') || 'harvests',
},
'cd(azblob)': cd_azblob,
'cd(file)': cd_file
'cd(file)': cd_file,
},
deadletter: {
provider: config.get('CRAWLER_DEADLETTER_PROVIDER') || crawlerStoreProvider,
'cd(azblob)': cd_azblob,
'cd(file)': cd_file
'cd(file)': cd_file,
},
queue: {
provider: config.get('CRAWLER_QUEUE_PROVIDER') || 'memory',
memory: {
weights: { immediate: 3, soon: 2, normal: 3, later: 2 }
weights: { immediate: 3, soon: 2, normal: 3, later: 2 },
},
storageQueue: {
weights: { immediate: 3, soon: 2, normal: 3, later: 2 },
Expand All @@ -132,8 +132,8 @@ module.exports = {
visibilityTimeout_remainLocal: fetchedCacheTtlSeconds,
maxDequeueCount: 5,
attenuation: {
ttl: 3000
}
}
}
ttl: 3000,
},
},
},
}
16 changes: 8 additions & 8 deletions config/cdMemoryConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@
module.exports = {
crawler: {
count: 1,
maxRequeueAttemptCount: 5
maxRequeueAttemptCount: 5,
},
fetch: {
github: {}
github: {},
},
process: {
scancode: {},
licensee: {},
reuse: {}
reuse: {},
},
store: {
provider: 'memory'
provider: 'memory',
},
deadletter: {
provider: 'memory'
provider: 'memory',
},
queue: {
provider: 'memory',
memory: {
weights: { events: 10, immediate: 3, soon: 2, normal: 3, later: 2 }
}
}
weights: { events: 10, immediate: 3, soon: 2, normal: 3, later: 2 },
},
},
}
32 changes: 16 additions & 16 deletions config/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const source = {
licensee,
reuse,
scancode,
fossology
fossology,
}

const npm = {
Expand All @@ -32,7 +32,7 @@ const npm = {
licensee,
reuse,
scancode,
fossology
fossology,
}

const conda = {
Expand All @@ -42,7 +42,7 @@ const conda = {
licensee,
reuse,
scancode,
fossology
fossology,
}

const crate = {
Expand All @@ -52,7 +52,7 @@ const crate = {
licensee,
reuse,
scancode,
fossology
fossology,
}

const deb = {
Expand All @@ -62,7 +62,7 @@ const deb = {
licensee,
reuse,
scancode,
fossology
fossology,
}

const go = {
Expand All @@ -72,7 +72,7 @@ const go = {
licensee,
reuse,
scancode,
fossology
fossology,
}

const maven = {
Expand All @@ -82,7 +82,7 @@ const maven = {
licensee,
reuse,
scancode,
fossology
fossology,
}

const nuget = {
Expand All @@ -91,7 +91,7 @@ const nuget = {
clearlydefined,
licensee,
scancode,
reuse
reuse,
}

const pod = {
Expand All @@ -101,7 +101,7 @@ const pod = {
licensee,
reuse,
scancode,
fossology
fossology,
}

const pypi = {
Expand All @@ -111,7 +111,7 @@ const pypi = {
licensee,
reuse,
scancode,
fossology
fossology,
}

const composer = {
Expand All @@ -121,7 +121,7 @@ const composer = {
licensee,
reuse,
scancode,
fossology
fossology,
}

const gem = {
Expand All @@ -131,7 +131,7 @@ const gem = {
licensee,
reuse,
scancode,
fossology
fossology,
}

const _package = {
Expand All @@ -146,13 +146,13 @@ const _package = {
pod,
pypi,
composer,
gem
gem,
}

const component = {
_type: 'component',
source,
package: _package
package: _package,
}

const entities = {
Expand All @@ -176,9 +176,9 @@ const entities = {
composer,
pod,
pypi,
gem
gem,
}

module.exports = {
default: entities
default: entities,
}
2 changes: 1 addition & 1 deletion dev-scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ run.foo -- Runs the docker container, killing a previous run if it exists. Hosts

### Extra:

debug.foo -- Does everything run does, but also pauses execution until a debugger is attached. Attach using vscode's profile.
debug.foo -- Does everything run does, but also pauses execution until a debugger is attached. Attach using vscode's profile.
Loading

0 comments on commit 1faa1dd

Please sign in to comment.