unused/data/config.yml
Joshua Clayton 7fe32edc4d
Support projections-style transformations to reduce false-positives
Basic aliases (e.g. `admin?`/`be_admin`) can be represented easily with simple
wildcards, but more complex transformations require a different mechanism.

Instead of using `%s` to represent strings that can be replaced 1:1, this
introduces a syntax inspired by https://github.com/tpope/vim-projectionist, as
such:

    - name: Rails
      aliases:
      - from: "*Validator"
        to: "{snakecase}"

This would find `AbsoluteUriValidator` and also match `absolute_uri`, which
would be found if the validation was in use.

This currently supports the `camelcase` and `snakecase` transformations,
as well as no transformation.

Closes #18
2016-07-19 15:14:34 -04:00

87 lines
1.8 KiB
YAML

- name: Rails
aliases:
- from: "*?"
to: "be_{}"
- from: "has_*?"
to: "have_{}"
- from: "*Validator"
to: "{snakecase}"
allowedTerms:
# serialization
- as_json
# inflection
- Inflector
# Concerns
- ClassMethods
- class_methods
- included
# rendering
- to_partial_path
autoLowLikelihood:
- name: Migration
pathStartsWith: db/migrate/
classOrModule: true
appOccurrences: 1
- name: Migration Helper
pathStartsWith: db/migrate/
allowedTerms:
- up
- down
- change
- index
- name: i18n
allowedTerms:
- t
- l
pathEndsWith: .rb
- name: Controller
pathStartsWith: app/controllers
termEndsWith: Controller
classOrModule: true
- name: Helper
pathStartsWith: app/helpers
termEndsWith: Helper
classOrModule: true
- name: Phoenix
allowedTerms:
- Mixfile
- __using__
autoLowLikelihood:
- name: Migration
pathStartsWith: priv/repo/migrations
classOrModule: true
- name: View
pathStartsWith: web/views/
termEndsWith: View
classOrModule: true
- name: Test
pathStartsWith: test/
termEndsWith: Test
classOrModule: true
- name: Controller actions
pathStartsWith: web/controllers
allowedTerms:
- index
- new
- create
- show
- edit
- update
- destroy
- name: Haskell
allowedTerms: []
autoLowLikelihood:
- name: Spec
pathStartsWith: test/
termEndsWith: Spec
classOrModule: true
- name: Cabalfile
pathEndsWith: .cabal
appOccurrences: 1
- name: TypeClasses
termEquals: instance
pathEndsWith: .hs
- name: Spec functions
termEquals: spec
pathStartsWith: test/