Provide a way to enforce file names
See original GitHub issueCurrently, you can only create visitors for a node type. We would like to be able specify a visitor for a file.
An example would be if I would like to enforce that all the schemas in a file need to be in alphabetical order.
Currently, to add rules for a specific file I have to specify a random OpenAPISchema
type definition in a rule, check that the context.filePath
is in the file that I expect, and then apply my validation rules.
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
How can I enforce filename and folder name convention in ...
I am looking for a rule which can enforce filename to be camelCase and folder name to be snake_case . How can I...
Read more >Enforce File Names Conventions · Issue #2412 - GitHub
One thing I've noticed in my code-base is that it's hard to get people to stay consistent on file naming conventions.
Read more >Use GPO to enforce file naming convention for users
The only thing you can do to facilitate this with GPO's is enforce audit policies on key shares and then use a log...
Read more >File Naming Conventions | Data Management
A file naming convention is a framework for naming your files in a way that describes what they contain and how they relate...
Read more >File Naming Conventions - HURIDOCS
A file naming convention is a systematic method for naming files that will ... Use relevant components in your file names to provide...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This would be a killer feature for us. We want to use openapi-cli as a linter that enforces a consistent folder/file structure in all of our APIs, so any developer in the company can easily work on any API in the company without having to learn a new structure each time. Here’s the structure that we’re enforcing:
So we need to be able to create file-level rules such as:
openapi.yaml
info.yaml
must exist and must contain the API’s info sectiontags.yaml
must exist and must contain the list of tagspaths/xxx/yyy/path.yaml
filepaths/xxx/yyy/VERB.yaml
fileschemas/xxx.yaml
fileenums.yaml
enums.yaml
must be in alphabetical orderI’m going to close this since it can be used for
$ref
filename checks. I’m not sure what other filename would want to be checked besides the root file?