Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running powershell linter on Mac #2128

Closed
JonasCordsen opened this issue Dec 8, 2022 · 1 comment
Closed

Error when running powershell linter on Mac #2128

JonasCordsen opened this issue Dec 8, 2022 · 1 comment
Labels
question Further information is requested

Comments

@JonasCordsen
Copy link

I am trying to run megaliter locally on my Mac M1pro chip and powershell 7.3

Is there a support issue or is this a bug?
If I run the PSScriptAnalyzer (not in mega-lint) in hand it works as expected

I use the command:
npx mega-linter-runner -e 'ENABLE=POWERSHELL' -e 'SHOW_ELAPSED_TIME=true'

Output:

Pulling docker image oxsecurity/megalinter:v6 ... 
INFO: this operation can be long during the first use of mega-linter-runner
The next runs, it will be immediate (thanks to docker cache !)
v6: Pulling from oxsecurity/megalinter
Digest: sha256:940919521dcafea408677526bdbe6ea1771d88c1c4afa5e170799a9ef349c3f8
Status: Image is up to date for oxsecurity/megalinter:v6
docker.io/oxsecurity/megalinter:v6
Command: docker run -v /var/run/docker.sock:/var/run/docker.sock:rw -v /Users/jonascordsen/Documents/Fellowmind/Fellowmind/connectivity:/tmp/lint:rw -e ENABLE=POWERSHELL -e SHOW_ELAPSED_TIME=true oxsecurity/megalinter:v6
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Skipped setting git safe.directory DEFAULT_WORKSPACE:  ...
Setting git safe.directory default: /github/workspace ...
Setting git safe.directory to /tmp/lint ...
[MegaLinter init] ONE-SHOT RUN
[config] /tmp/lint/.mega-linter.yml + Environment variables
----------------------------------------------------------------------------------------------------
------------------------------------ MegaLinter, by OX Security ------------------------------------
----------------------------------------------------------------------------------------------------
 - Image Creation Date: 2022-11-23T22:11:59Z
 - Image Revision: d8612e7
 - Image Version: v6
----------------------------------------------------------------------------------------------------
The MegaLinter documentation can be found at:
 - https://megalinter.io/latest
----------------------------------------------------------------------------------------------------
MegaLinter initialization

MARKDOWN_REMARK_LINT has been temporary disabled in MegaLinter, please use a previous MegaLinter version or wait for the next one !
Skipped linters: ACTION_ACTIONLINT, ANSIBLE_ANSIBLE_LINT, ARM_ARM_TTK, BASH_EXEC, BASH_SHELLCHECK, BASH_SHFMT, BICEP_BICEP_LINTER, CLOJURE_CLJ_KONDO, CLOUDFORMATION_CFN_LINT, COFFEE_COFFEELINT, COPYPASTE_JSCPD, CPP_CPPLINT, CSHARP_DOTNET_FORMAT, CSS_SCSS_LINT, CSS_STYLELINT, C_CPPLINT, DART_DARTANALYZER, DOCKERFILE_HADOLINT, EDITORCONFIG_EDITORCONFIG_CHECKER, ENV_DOTENV_LINTER, GHERKIN_GHERKIN_LINT, GO_GOLANGCI_LINT, GO_REVIVE, GRAPHQL_GRAPHQL_SCHEMA_LINTER, GROOVY_NPM_GROOVY_LINT, HTML_DJLINT, HTML_HTMLHINT, JAVASCRIPT_ES, JAVASCRIPT_PRETTIER, JAVASCRIPT_STANDARD, JAVA_CHECKSTYLE, JAVA_PMD, JSON_ESLINT_PLUGIN_JSONC, JSON_JSONLINT, JSON_PRETTIER, JSON_V8R, JSX_ESLINT, KOTLIN_KTLINT, KUBERNETES_KUBECONFORM, KUBERNETES_KUBEVAL, LATEX_CHKTEX, LUA_LUACHECK, MAKEFILE_CHECKMAKE, MARKDOWN_MARKDOWNLINT, MARKDOWN_MARKDOWN_LINK_CHECK, MARKDOWN_MARKDOWN_TABLE_FORMATTER, MARKDOWN_REMARK_LINT, OPENAPI_SPECTRAL, PERL_PERLCRITIC, PHP_PHPCS, PHP_PHPLINT, PHP_PHPSTAN, PHP_PSALM, PROTOBUF_PROTOLINT, PUPPET_PUPPET_LINT, PYTHON_BANDIT, PYTHON_BLACK, PYTHON_FLAKE8, PYTHON_ISORT, PYTHON_MYPY, PYTHON_PYLINT, PYTHON_PYRIGHT, RAKU_RAKU, REPOSITORY_CHECKOV, REPOSITORY_DEVSKIM, REPOSITORY_DUSTILOCK, REPOSITORY_GITLEAKS, REPOSITORY_GIT_DIFF, REPOSITORY_GOODCHECK, REPOSITORY_SECRETLINT, REPOSITORY_SEMGREP, REPOSITORY_SYFT, REPOSITORY_TRIVY, RST_RSTCHECK, RST_RSTFMT, RST_RST_LINT, RUBY_RUBOCOP, RUST_CLIPPY, R_LINTR, SALESFORCE_SFDX_SCANNER_APEX, SALESFORCE_SFDX_SCANNER_AURA, SALESFORCE_SFDX_SCANNER_LWC, SCALA_SCALAFIX, SNAKEMAKE_LINT, SNAKEMAKE_SNAKEFMT, SPELL_CSPELL, SPELL_MISSPELL, SPELL_PROSELINT, SQL_SQLFLUFF, SQL_SQL_LINT, SQL_TSQLLINT, SWIFT_SWIFTLINT, TEKTON_TEKTON_LINT, TERRAFORM_CHECKOV, TERRAFORM_KICS, TERRAFORM_TERRAFORM_FMT, TERRAFORM_TERRAGRUNT, TERRAFORM_TERRASCAN, TERRAFORM_TFLINT, TSX_ESLINT, TYPESCRIPT_ES, TYPESCRIPT_PRETTIER, TYPESCRIPT_STANDARD, VBDOTNET_DOTNET_FORMAT, XML_XMLLINT, YAML_PRETTIER, YAML_V8R, YAML_YAMLLINT
To receive reports as email, please set variable EMAIL_REPORTER_EMAIL


    .:oool'                                  ,looo;                           
    .xNXNXl                                 .dXNNXo.                          
     lXXXX0c.                              'oKXXN0;                           
     .oKNXNX0kxdddddddoc,.    .;lodddddddxk0XXXX0c                            
      .:kKXXXXXXXXXXXXNXX0dllx0XXXXXXXXXXXXXXXKd,                             
        .,cdkOOOOOOOO0KXXXXXXXXXXK0OOOOOOOkxo:'                               
                      'ckKXNNNXkc'                                            
              ':::::;.  .c0XX0l.  .;::::;.                                    
              'xXXXXXx'   :kx:   ;OXXXXKd.                                    
               .dKNNXXO;   ..   :0XXXXKl.                                     
                .lKXXXX0:     .lKXXXX0:                                       
                  :0XXXXKl.  .dXXXXXk,                                        
                   ;kXXXXKd:cxXXXXXx'                                         
                    'xXNXXXXXXXXXKo.                                          
                     .oKXXXXNXXX0l.                                           
                      .lKNNXNNXO:                                             
                        ,looool'                                              

==========================================================
=============   MegaLinter, by Ox.security   =============
==========================================================

MegaLinter now collects the files to analyse
Listing all files in directory [/tmp/lint], then filter with:
- File extensions: .cdxml, .ps1, .ps1xml, .psd1, .psm1, .psrc, .pssc
- Excluding .gitignored files [4]: /tmp/lint/megalinter-reports/IDE-config.txt, /tmp/lint/megalinter-reports/IDE-config/.vscode/extensions.json, /tmp/lint/megalinter-reports/linters_logs/ERROR-POWERSHELL_POWERSHELL.log, /tmp/lint/megalinter-reports/megalinter.log
Kept [12] files on [76] found files

+----MATCHING LINTERS-----+---------------------------------------------+----------------+------------+
| Descriptor | Linter     | Criteria                                    | Matching files | Format/Fix |
+------------+------------+---------------------------------------------+----------------+------------+
| POWERSHELL | powershell | .ps1|.psm1|.psd1|.ps1xml|.pssc|.psrc|.cdxml | 12             | no         |
+------------+------------+---------------------------------------------+----------------+------------+

❌ Linted [POWERSHELL] files with [powershell]: Found 1 error(s) - (58.55s)
- Using [powershell v7.3.0] https://megalinter.io/latest/descriptors/powershell_powershell
- MegaLinter key: [POWERSHELL_POWERSHELL]
- Rules config: [/tests/.mega-linter/.powershell-PSScriptAnalyzer.psd1]
- Number of files analyzed: [12]
[powershell] deploy.ps1 - SUCCESS - 0 error(s)
--Error detail:
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

[powershell] docs/Update-Documentation.ps1 - ERROR - 1 error(s)
--Error detail:
Invoke-ScriptAnalyzer: Input PSVersionTable has invalid PSVersion value type

[powershell] src/autoDocumentation/alertsToDocs.ps1 - SUCCESS - 0 error(s)
--Error detail:
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

[powershell] src/autoDocumentation/alertsToDocs.psm1 - SUCCESS - 0 error(s)
--Error detail:
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

[powershell] src/powershell/public/Cleanup-VWANPeering.psm1 - SUCCESS - 0 error(s)
--Error detail:
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

[powershell] tests/.mega-linter/.powershell-PSScriptAnalyzer.psd1 - SUCCESS - 0 error(s)
--Error detail:
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

[powershell] tests/Alerts.Tests.ps1 - SUCCESS - 0 error(s)
--Error detail:
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

[powershell] tests/Documentation.test.ps1 - SUCCESS - 0 error(s)
--Error detail:
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

[powershell] tests/Firewall.Tests.ps1 - SUCCESS - 0 error(s)
--Error detail:
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

[powershell] tests/FolderStructure.Tests.ps1 - SUCCESS - 0 error(s)
--Error detail:
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

[powershell] tests/PS-Rule/PSRulePreDeployment.ps1 - SUCCESS - 0 error(s)
--Error detail:
qemu: uncaught target signal 11 (Segmentation fault) - core dumped

[powershell] tests/pester.ps1 - SUCCESS - 0 error(s)
--Error detail:
qemu: uncaught target signal 11 (Segmentation fault) - core dumped



+----SUMMARY----+------------+------+-------+-------+--------+--------------+
| Descriptor    | Linter     | Mode | Files | Fixed | Errors | Elapsed time |
+---------------+------------+------+-------+-------+--------+--------------+
| ❌ POWERSHELL | powershell | file |    12 |       |      1 |       58.55s |
+---------------+------------+------+-------+-------+--------+--------------+

You could have same capabilities but better runtime performances if you use a MegaLinter flavor:
- [dotnet] oxsecurity/megalinter/flavors/dotnet@v6 (56 linters) https://megalinter.io/latest/flavors/dotnet/

[Updated Sources Reporter] No source file has been formatted or fixed
❌ Error(s) have been found during linting
To disable linters or customize their checks, you can use a .mega-linter.yml file at the root of your repository
More info at https://megalinter.io/latest/configuration/
@JonasCordsen JonasCordsen added the question Further information is requested label Dec 8, 2022
@nvuillam
Copy link
Member

nvuillam commented Dec 20, 2022

It seems to be a M1 related issue... ( cf docker/for-mac#5123 )

a task has been started about that, but can't promise anything about its release date ....

Issue --> #1180
PR draft --> #1553

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants