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

Config file ignored #72

Open
zettadam opened this issue Jan 28, 2024 · 1 comment
Open

Config file ignored #72

zettadam opened this issue Jan 28, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@zettadam
Copy link

Hi,

I have installed fta-cli@1.0.0 on my MacBook. I want to run static analysis on code in a project, but not on any tests, documentation or Storybook stories, etc. that are placed near source code.

Here is my fta.json file that is completely ignored by fta running from npm script in package.json, npm run --config-path="./fta.json":

{
  "output_limit": 5000,
  "score_cap": 1000,
  "include_comments": false,
  "exclude_under": 6,
  "exclude_directories": [],
  "exclude_filenames": [
    ".spec.jsx",
    ".stories.tsx",
    ".docs.mdx",
    ".types.ts",
    ".d.ts"
  ],
  "extensions": [
    ".js",
    ".jsx",
    ".ts",
    ".tsx"
  ]
}

My fta.json is located in the root of the project and according to documentation it should be picked up automatically, but it does not. Specifying --config-path does not help. I want to ignore any .spec, .docs or. stories, or .types files included in src but this is the output I get:

ftp-output-head

I tried changing other configuration in the file, like output_limit but they get ignored, too.

@sgb-io
Copy link
Owner

sgb-io commented Jan 28, 2024

Hi @zettadam thanks for reporting. This might be due to some quirkiness of how the exclude/extensions options work.

Do you still have the problem if you clear out extensions? It seems like something is overriding your exclusions. You could also try values like *.spec.jsx (including the asterisks) to see if it changes the result.

@bencollins54 bencollins54 added the bug Something isn't working label Jan 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants