codacy / codacy-analysis-cli

The Codacy Analysis CLI is a command line interface that enables you to execute Codacy code analysis locally.
https://www.codacy.com
GNU Affero General Public License v3.0
95 stars 33 forks source link

[TS-434] codacy-analysis-cli validate-configuration does not inform about file not starting with `---` #482

Open AlexBaranowski opened 1 year ago

AlexBaranowski commented 1 year ago

Hi!

First of all, I'm thankful for Your product. Great job!

Yesterday I was playing with the Codacy config file. In documentation, there is the section with important paragraph https://docs.codacy.com/repositories-configure/codacy-configuration-file/#codacy-configuration-file saying that file must start with the ---.

OFC during writing my own .codacy.yml I somehow missed it. I validated the file with the:

codacy-analysis-cli validate-configuration --directory $(pwd)

And it did not inform me about this mistake.

To sum it up:

File

---
exclude_paths:
  - "**/testsuite/**"

output

Successfully loaded the Codacy configuration file in /home/Alex/tmp/XXX/.codacy.yaml
CodacyConfigurationFile(None, Some(Set(Glob("**/testsuite/**"))), None)

File without ---

exclude_paths:
  - "**/testsuite/**"

output

Successfully loaded the Codacy configuration file in /home/Alex/tmp/XXX/.codacy.yaml
CodacyConfigurationFile(None, Some(Set(Glob("**/testsuite/**"))), None)

I'm believing that for a file that does not begin with --- it should print an error.

Best, Alex

github-actions[bot] commented 1 year ago

Internal ticket created : TS-434