How can I get ember-cli to pickup my .jshintignore? - ember-cli

ember-cli is giving me hinting errors about a test file like mirage/config.js: and I want to disable the ember-cli hints.
I've tried creating a .jshintignore file with:
mirage/*
app/mirage/*
In both / and /app and I've created app/mirage/.jshintignore with:
*
Nothing is letting me ignore whole folders. Do I have any options besides placing a jshint directive in each file?

Related

Intellisense doesn't work in .spec files (works when I remove .spec)

I am writing test in Jest and files have .spec.ts extension.
I noticed that when I reference my classes, vscode doesn't automatically resolve their name and I have to provide path manually.
When I remove .spec from file it magically starts working and gives me hints to automatically import classes.
When I add .spec it stops working again.
Seems you can just rename spec.ts to test.ts and then it somehow works

VSCode: how to structure a simple python package with few modules and tests, debugging and linting?

I'm having more trouble than I'd like to admit to structure a simple project in Python to develop using Visual Studio Code.
How should I structure in my file system a project that is a simple Python package with a few modules? Just a bunch of *.py files together. My requisites are:
I must be able to step debug it in vscode.
It has a bunch of unit tests using pytest.
I can select to debug a specific test from vscode tab and it must stop in breakpoints.
pylint must not show any false positives.
The test files must be in a different directory of the main module files.
I must be able to run all the tests from the console.
The module is executed inside a virtual environment using python standard lib module venv
The code will use type hints
I may use another linter, even another test framework.
Nothing fancy, but I'm really having trouble to get it right. I want to know:
How should I organize my subdirectory: a folder with the main files and a sibling folder with the tests? Or a subfolder with the code and a subsubfolder with the tests?
Which dirs must have a init.py file?
How the tests should import the files from the module? Should I use relative imports?
Should I create a pytest.ini file?
Should I create a .env file?
What's the content of my launch.json the debugger file config in vscode?
Common dir structure:
app
__init__.py
yourappcode.py
tests (pytest looks for this)
__init__.py
test_yourunittests.py
server.py if you have one
.env
.coveragerc
README.md
Pipfile
.gitignore
pyproject.toml if you want
.vscode (helpful)
launch.json
settings.json
Or you could do one better. Ignore my structure and look at the some of famous python projects github page. Like fastAPI, Flask, asgi, aiohttp are some that I can think of right now
Also:
I think absolute imports are easier to work with compared to relative imports, I could be wrong though
vscode is able to use pytest. Make sure you have a testing extension. Vscode has a built in one im pretty sure. You can configure it to pytest and specify your test dir. You can also run your test from command line. If youre at the root, just running ‘pytest’ will recognise your tests dir if it’s named that by default. Also your actual test files need to start with prefix test_ i think.
The launch.json doesn’t need to be anything special. When you click on the settings button next to play button in the debug panel. Vscode will ask what kind of app is it. I.e If its a flask app, select python then select flask and it will auto generate a settings file which you can tweak however you want in order to get your app to run. I.e maybe you want to expose a different port or the commands to run your app are different
It sounds to me like you just need to spend a bit of time configuring vscode to your specific python needs. For example, you can use a virtualenv and linting in whichever way you want. You just need to have a settings.json file in the .vscode folder in your repo where you specify your settings. Configurations to specify python virtualenv and linting methods can be found online

How to recover frontend and backend css after deploy command

I have done below steps but after this frontend and backend css fonts will not working properly in magento2.
Remove pub/static //not .htaccess
Remove var/cache
Remove var/composer_home
Remove var/generation
Remove var/page_cache
Remove var/view_preprocessed
Then open up app/etc/di.xml find the path
Magento\Framework\App\View\Asset\MaterializationStrategy\Symlink
and replace it with Magento\Framework\App\View\Asset\MaterializationStrategy\Copy
And finally run this:
php bin/magento setup:static-content:deploy
I have been facing strange issue, as the part moving modifications in static content. we removed pub/static and deployed setup:static-content:deploy.
After doing this, files are generated properly in pub/static folder but when i load front end, styles are vanished.
As in the source the file paths are loading with version1483082446
root/static/version1483082446/frontend/Smartwave/porto/en_US/mage/calendar.css
I have followed below commands, but my styles are not loading in frontend.
Delete var/cache var/page_cache generated var/view_proceesed pub/static/frontend pub/static/adminhtml
Perform setup:upgrade di:compile content:deploy cache:flush
Give 777 permission to the pub var and generated folder.

babel watch support for renaming or moving files

I'm using the babel command with the --watch flag to transpile my code. However, when I move or rename a file, the old version of the file remains in the output directory. Is there any way to tell babel to do a clean when something like this happens or should I just switch to chokidar and do it myself?
Take a look at gulp-babel-wrap package
Seems like first option from Available tasks: section makes what you need - clean - wipes the destination directory (default 'dist'

how to run doctrine.php in command prompt

I'm trying to use Doctrine with Zend, I have copied the doctrine.php and doctrine file in the script folder in the Source Files folder.
However when I type in command prompt following command: "php doctrine.php" by entering in the scripts folder, Nothing happens, there is no error printed, the cursor just goes to next line. Can someone please tell me how can I use doctrine.php.
When using Guilherme's integration suite, you need to do a couple of things.
Download / clone the Doctrine Common, DBAL and ORM libraries and make sure they're available in your include path. For this, I usually just copy the lib/Doctrine code from each into my project's library folder. If using git, you can add them as subtree splits but that's a topic for another time ;-)
You also need the Symfony Console and Yaml namespaces. Again, it's easiest to place them in your project's library folder under library/Symfony/Component/Console and library/Symfony/Component/Yaml. These usually come as submodule dependencies in the Doctrine libraries but you can also get them from their github pages
Console
Yaml
Remove the bootstrap('Config') call from the doctrine.php script. Don't know what Guilherme was thinking there :-)
That's it, from there it should work as expected.