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

Doesn't allow setting compiler settings for filetypes instead of projects #13

Open
igemnace opened this issue Aug 5, 2018 · 1 comment

Comments

@igemnace
Copy link
Owner

igemnace commented Aug 5, 2018

After a discussion on #vim, the idea of having Makery config for filetypes, potentially across multiple projects, was brought up by m_ben and vxid. Use cases in mind were C++ and Python, for which multiple linters exist. The current Makery system works well for juggling the linters, although the project-specific nature of configuration will mean lots of duplicate .makery.json files.

No solid action plan for now, much less an implementation route. I'm leaving this space open for when I get a better idea of how to tackle this.

@mtreca
Copy link

mtreca commented Aug 13, 2018

I ended up defining a filetype-specific config in respective ftplugin files after looking at various vimrcs around github.

Vim-projectionist has a ProjectionistDetect hook that is run at each filetype change that can be used to update filetype-specific projections. Here is for instance my ftplugin/python.vim file:

autocmd User ProjectionistDetect
            \ call projectionist#append(getcwd(),
            \ {
            \   'src/*.py': {
            \     'alternate': 'tests/test_{}.py',
            \     'type': 'source',
            \     'makery': {
            \       'run': {'compiler': 'python'},
            \       'lint': {'compiler': 'pylint'},
            \       'check': {'compiler': 'flake8'},
            \     },
            \   },
            \   'tests/test_*.py': {
            \     'alternate': 'src/{}.py',
            \     'type': 'test',
            \     'makery': {
            \       'suite': {"makeprg": "python -m unittest discover"},
            \       'test': {"makeprg": "python -m unittest %"},
            \     }
            \   },
            \   '*.py': {
            \     'makery': {
            \       'run': {'compiler': 'python'},
            \       'lint': {'compiler': 'pylint'},
            \       'check': {'compiler': 'flake8'},
            \       }
            \   }
            \ })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants