Skip to content

Commit

Permalink
Merge pull request nautilus-cyberneering#288 from josecelano/issue-28…
Browse files Browse the repository at this point in the history
…7-update-megalinter

Update MegaLinter
  • Loading branch information
josecelano committed Jul 26, 2022
2 parents e9d8d8b + c33816e commit aaadf3d
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"ignorePaths": [
".vscode",
"**/.git/**",
"**/docs/images/**",
"**/node_modules/**",
"**/vscode-extension/**",
"cinder",
Expand All @@ -30,6 +31,7 @@
"eslintcache",
"Garnham",
"ghaction",
"GITLEAKS",
"GNUPGHOME",
"gpgsign",
"Gpgsign",
Expand All @@ -53,10 +55,12 @@
"ncipollo",
"noproxy",
"noreply",
"nosemgrep",
"nuxt",
"oidc",
"Oidc",
"openpgp",
"oxsecurity",
"Parens",
"pids",
"RELOADAGENT",
Expand All @@ -69,6 +73,7 @@
"strcmp",
"stringifying",
"STYLELINT",
"TRIVY",
"tsbuildinfo",
"venv",
"vercel",
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
branches: [main, develop]

permissions:
issues: write
pull-requests: write
statuses: write

Expand Down Expand Up @@ -37,7 +38,7 @@ jobs:
id: ml
# You can override MegaLinter flavor used to have faster performances
# More info at https://megalinter.github.io/flavors/
uses: megalinter/megalinter/flavors/javascript@v5
uses: oxsecurity/megalinter/flavors/javascript@v6
env:
# All available variables are described in documentation
# https://megalinter.github.io/configuration/
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ jobs:
# Import test GPG key
# secretlint-disable
{
# nosemgrep
echo -e "-----BEGIN PGP PRIVATE KEY BLOCK-----\n"
cat __tests__/fixtures/test-key-committer.pgp
echo -e "\n-----END PGP PRIVATE KEY BLOCK-----\n"
Expand Down
2 changes: 2 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ DEFAULT_BRANCH: main # Usually master or main
# - SPELL # Uncomment to disable checks of spelling mistakes
DISABLE_LINTERS:
- TYPESCRIPT_STANDARD
- REPOSITORY_GITLEAKS
- REPOSITORY_TRIVY
SHOW_ELAPSED_TIME: true
FILEIO_REPORTER: false
JAVASCRIPT_ES_FILTER_REGEX_EXCLUDE: (dist|cinder|jest.config.js)
Expand Down
3 changes: 3 additions & 0 deletions .semgrepignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cinder/
dist/
megalinter-reports/
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Document format should be Markdown unless an alternative format is really necess

## Style guides

In this repository we use Megalinter. We recommend you to install the local checker so as to speed up your contribution process. You will find the local installation options at the bottom of the page: <https://megalinter.github.io/v5/installation/>.
In this repository we use Megalinter. We recommend you to install the local checker so as to speed up your contribution process. You will find the local installation options at the bottom of the page: <https://oxsecurity.github.io/megalinter/v5/installation/>.

### Code style guide

Expand Down
1 change: 1 addition & 0 deletions __tests__/unit/queue.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ describe('Queue', () => {

const output = gitLogForLatestCommit(gitRepo.getDirPath())

// nosemgrep
expect(RegExp(`gpg:.+RSA.+${signingKeyFingerprint}`).test(output)).toBe(
true
)
Expand Down
2 changes: 2 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ In order to contribute you should follow the next steps:

3. Make your changes and commit them using [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format. Make sure you sign your commits.

4. It is very important that all commits have a distribution package of the application. That means you should run always: `yarn install && yarn build && yarn package` before committing. That sometimes changes the content of the `dist` folder. Those changes should be included in the commit. We encourage you tu run `yarn install && yarn all` before committing. That command is going to build the app but it's also going to test it and fix the TypeScript linting.
4. It is very important that all commits have a distribution package of the application. That means you should run always: `yarn install && yarn build && yarn package` before committing. That sometimes changes the content of the `dist` folder. Those changes should be included in the commit. That command is going to build the app but it's also going to test it and fix the TypeScript linting.

5. The target branch for your pull request should be `develop`. Keep you branch rebased with `develop` branch.

Expand Down
1 change: 1 addition & 0 deletions src/__tests__/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export function testConfiguration(): TestConfig {
)

// secretlint-disable
// nosemgrep
const gpgPrivateKey = `-----BEGIN PGP PRIVATE KEY BLOCK-----\n\n${gpgPrivateKeyBody}\n-----END PGP PRIVATE KEY BLOCK-----`
// secretlint-enable

Expand Down
1 change: 1 addition & 0 deletions src/__tests__/gpg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export const overwriteAgentConfiguration = async (
config: string,
homedir: string
): Promise<void> => {
// nosemgrep
const gpgAgentConfPath: string = path.join(homedir, 'gpg-agent.conf')

fs.writeFile(gpgAgentConfPath, config, function (err) {
Expand Down
5 changes: 3 additions & 2 deletions src/git-repo-dir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ export class GitRepoDir {
this.dirPath = this.normalizePath(dirPath)
}

guardThatDirExists(dirPath): void {
guardThatDirExists(dirPath: string): void {
if (!existsSync(dirPath)) {
throw new GitDirNotFoundError(dirPath)
}
}

normalizePath(dirPath): string {
normalizePath(dirPath: string): string {
// nosemgrep
return isAbsolute(dirPath) ? dirPath : resolve(dirPath)
}

Expand Down
3 changes: 2 additions & 1 deletion src/queue-name.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export class QueueName implements Nullable {
return this.value === other.value
}

guardThatNameIsValid(value): void {
guardThatNameIsValid(value: string): void {
// nosemgrep
if (!RegExp(`^[a-z-_ ]{1,${MAX_QUEUE_NAME_LENGTH}}$`).test(value)) {
throw new QueueNameNotValidError(value)
}
Expand Down

0 comments on commit aaadf3d

Please sign in to comment.